THE SITUATION:
I am trying to display preroll ads videos on my app.
I have two different adTagUrl
.
One works fine and the preroll ad is displayed.
The other doesn't, and I get an empty VAST response instead.
I thought there may be something wrong in the code, so I recreate a basic small app taking the code from the google IMA repo example.
The results is the same. One work and the other doesn't.
THE ERROR:
errorCode: 1009
errorMessage: "The VAST response document is empty."
type: "adLoadError"
VAST INSPECTOR:
If I check the VAST ad response using the Google Video Suite Inspector, both the adTagUrl
work.
THE CODE:
The code is very straightforward, taken from the google IMA example repo:
var adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = 'MY_TAG_URL';
adsRequest.linearAdSlotWidth = 640;
adsRequest.linearAdSlotHeight = 400;
adsRequest.nonLinearAdSlotWidth = 640;
adsRequest.nonLinearAdSlotHeight = 150;
adsLoader.requestAds(adsRequest);
THE QUESTION:
Why am I getting that error?
How it's possible that the adTagUrl works fine in the Vast Inspector, but it doesn't work when I request it from the code?