When using the IMA player + GAM, passing an URL to the IMA player and letting the IMA player make the request to GAM still results in better revenue.
That is why, in the above case, using a hybrid approach is the best solution that doesn't require an external VAST cache:
- When you have a winning prebid bid, you ask Prebid to contact GAM and download the VAST XML, and pass that to the IMA player using the
getVastXml method
- When you don't have a winning prebid bid, you ask Prebid for the GAM URL and let the IMA player do the request using the
buildVideoUrl method
I want to be able to use the second approach (pass a GAM url to IMA, and let IMA do the request) when I have a winning prebid bid that doesn't need the local cache.
Currently that isn't possible because e.g. for Rubicon, when I receive a bid which contains
vastUrl: https://prebid-server.rubiconproject.com/cache?uuid=foo
the GAM URL I get from Prebid will contain
hb_uuid=bar
hb_uuid_rubicon=bar
where bar is a uuid from the local cache.
However, if at this point I would let the IMA player make the request, the replacing of bar with foo won't happen and the IMA player cannot download the VAST XML.
That forces me to use the getVastXml method instead of being able to use the buildVideoUrl method with the improved GAM auction.
I think this issue would need changes in 2 places:
Skip local storage when not needed:
export const storeLocally = (bid) => {
//When the bid is already stored in a remote cache, no need to store it locally
if(bid.vastUrl){
return
}
const vastXml = getVastXml(bid);
const bidVastUrl = URL.createObjectURL(new Blob([vastXml], { type: 'text/xml' }));
assignVastUrlAndCacheId(bid, bidVastUrl);
vastLocalCache.set(bid.videoCacheKey, bidVastUrl);
};
Only try replacing UUIDs in the bid when it is coming from the remote cache
In getVastForLocallyCachedBids, replace the
if (!vastAdTagUriElement || !vastAdTagUriElement.textContent) {
return gamVastWrapper;
}
check with
if (!vastAdTagUriElement || !vastAdTagUriElement.textContent || !vastAdTagUriElement.textContent.startsWith(config.getConfig('cache.url'))) {
return gamVastWrapper;
}
This relies on the cache.url being specified, but according to the docs, this is a required property anyway.
When using the IMA player + GAM, passing an URL to the IMA player and letting the IMA player make the request to GAM still results in better revenue.
That is why, in the above case, using a hybrid approach is the best solution that doesn't require an external VAST cache:
getVastXmlmethodbuildVideoUrlmethodI want to be able to use the second approach (pass a GAM url to IMA, and let IMA do the request) when I have a winning prebid bid that doesn't need the local cache.
Currently that isn't possible because e.g. for Rubicon, when I receive a bid which contains
the GAM URL I get from Prebid will contain
where
baris a uuid from the local cache.However, if at this point I would let the IMA player make the request, the replacing of
barwithfoowon't happen and the IMA player cannot download the VAST XML.That forces me to use the
getVastXmlmethod instead of being able to use thebuildVideoUrlmethod with the improved GAM auction.I think this issue would need changes in 2 places:
Skip local storage when not needed:
Only try replacing UUIDs in the bid when it is coming from the remote cache
In
getVastForLocallyCachedBids, replace thecheck with
This relies on the
cache.urlbeing specified, but according to the docs, this is a required property anyway.