googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
450 stars 284 forks source link

How to Log Vast XML response? #943

Closed damjan25 closed 4 years ago

damjan25 commented 4 years ago

Is it possible to log vast XML response from ima ?

For example for vast tag like this: https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=

I would like to see what is inside vast XML before or after ad is loaded.

Kiro705 commented 4 years ago

Hello @damjan25 ,

It is possible to view the VAST XML response in Chrome's network tab (see screenshot).

However, IMA does not provide a method of logging this VAST XML response.

vast_view-screenshot
damjan25 commented 4 years ago

@Kiro705 is it possible to console.log firstQuartile link from the XML if you listen on event LOADED or maybe ADSREADY ? 🤔 for example like this:

player.ima.addEventListener(EventType.LOADED, (e) => {
      console.log(e.firstQuartile)
})
Kiro705 commented 4 years ago

Hello, @damjan25 ,

The most information about the ad is available using the getAdData() method. You can call it in the LOADED event like this:

player.ima.addEventListener(google.ima.AdEvent.Type.LOADED, (e) => {
      console.log(e.getAdData());
});
damjan25 commented 4 years ago

e.getAdData():

image

Hmm there is really not that much data in e.getAdData() obj :thinking: will there be support in there future to LOG xml from vast tags like this one ? Because it is really hard to debug in IOS real device when you get 303 error or 1009 error and you cant really check if some tracking links are missing in the XML or is the whole vast empty and its throwing the error :( (atleast not with the vast tags like the one in the ticket description, with some of them is really nice where you can log the hole vast xml and check it)

komw commented 3 years ago

@damjan25 did you found how to get XML content from ad tag?

damjan25 commented 3 years ago

@komw unfortunately no. Found partial solution for some vast tags, but it did not work for all vast tags so it wasn't good enough for production and since then I havent looked into it anymore. :/