vast-client-js
vast-client-js copied to clipboard
Config for allowMultipleAds
VAST is complex and many providers (demand sources) have mixed interpretation of "sequence" when there is a standalone ad. Even the samples on IAB have sequence in standalone ads. see: https://github.com/InteractiveAdvertisingBureau/VAST_Samples/tree/master/VAST%204.0%20Samples
Google Ad Manager does not seem to have a way to set "allowMultipleAds" for their wrappers either.
It would help to be able to set this to true at the parser lever to mitigate inconsistencies in providers, else wrapped standalone ads will not play when they have a "sequence=1".
Hello @philn5d-ar, Indeed as IAB specifiy:
allowMultipleAds: a Boolean value that identifies whether multiple ads are allowed in the requested VAST response. If true, both Pods and stand-alone ads are allowed. If false, only the first stand-alone Ad (with no sequence values) in the requested VAST response is allowed. Default value is “false.”
I recognise that it is an issue when you don't have controls on the value of allowMultipleAds, with the default value set to false and by not accepting ads alone with a sequence attribute knowing that a lot of provider does it and even IAB..
It's a good idea to provide a parameter that we could set a top level inside vastClient/vastParser, please feel free to contribute following our guidelines if you want to speed up the process (it's also a great opportunity to participate in Hacktoberfest 2020! 🎉)
Hello, The PR has been merged and is available since the 3.1.0 release, please update to the latest version and you will be able to set allowMultipleAds value.
As explained in the API documentation, you can set the value using the parameter option
for following functions:
- VastClient
-
get(url, options)
API link
-
- VastParser
If you would like to override the allowMultipleAds default value value to true you could set option
object like so const options = { allowMultipleAds: true}
before calling one of above method.
Hi @ZacharieTFR,
currently I have the same issue, even though the vastService version is 3.2.0, and I set the allowMultipleAds and resolveAll options to true it still returns only one ad. The vastxmlfile has two or more ads which I've to show but the get(url, options) returns only one ad.
Also I checked if the vast service has remaining ads with the method hasRemainingAds() but it returns false.
Can you please explain explain to me if there is another config that I must set or not set in case I want to get multiple ads?
Thank you,
Rrustem
@rrustemh this helped me:
const response = await this.vastClient.get(url, { allowMultipleAds: true, resolveAll: true, })