Missing events in the HTML5 IMA SDK: AdEvent.Type. SKIPPED

625 views
Skip to first unread message

Greg Kindel

unread,
May 9, 2016, 1:02:43 PM5/9/16
to Interactive Media Ads SDK


Hi,

I'm currently flushing our our HTML5 IMA integration and am trying to have it match our Flash one as much as possible.  In testing, I'm noticing that a few events fail to fire successfully. 

Though documented in the API reference, SKIPPED does not make it to my attached event listener.  

Using breakpoints, I can see that the "skip" event does actually fire, but for some reason shorts out before the the callback is invoked because it is not mapped in some internal object which is concatenated.   See attached image for the context, but the basic code is the following. In the "skip" case, a.o.b["skip"] is not defined, where it is for over events.



Using the debug sdk, I can see that even though the SDK-side event does not fire, it does get correctly recorded back to ad servers, which is good.


[ 15.915s] [ima.vast.VideoAdEventTracker] dispatching event skip
[ 15.934s] [ima.vast.VastAdServerReporter] Reporting urls for event : skip
[ 15.935s] [ima.vast.VastAdServerReporter] Pinging reporting URL: [...]

Probably unrelated to this specific bug, but it is worth mentioning that I'm never seeing DURATION_CHANGE or AD_METADATA fire, but I can work around those. Worth mentioning. 

Thanks!



Binny Patel (IMA SDK Team)

unread,
May 9, 2016, 3:59:08 PM5/9/16
to Interactive Media Ads SDK
Hi Greg,

I would require extra information from your side to be able to reproduce the issue. 

1) Could you provide me your Ad tag?
2) Can you also provide me the list of events that are failing for you?

You can have a look at our sample tag implementation, which would fire the skip event when you skip the ad.

The DURATION_CHANGE will be fired when the ad's duration changes, and it will depend on the ad duration that is described in the Ad tag. When there are multiple ads in the ad tag, once all ads get loaded, AD_METADATA will get fired.

Thanks,

Binny Patel
IMA SDK Team
Screen Shot 2016-05-09 at 3.32.15 PM.png

Greg Kindel

unread,
May 9, 2016, 6:56:42 PM5/9/16
to Interactive Media Ads SDK

Hi Binny,

Thanks for getting back so quickly.  I was using the sample skippable from this guide. https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags

I've gone ahead and created a minimal test case page.  There's no <video>, but that shouldn't matter.  The code is largely from the Getting Started guide.  http://codepen.io/gkindel/pen/XdOQrL

Just noticed USER_CLOSE is also missing, as only the ALL_ADS_COMPLETED and CONTENT_RESUME_REQUESTED fire after the click to skip.  Not sure of the semantics on this one, but it fires in the Flash SDK on skip.

To recap, here are the document events that are not being fired:
  • SKIP
  • USER_CLOSE
  • AD_METADATA*
  • DURATION_CHANGE*
(*for what it's worth, these two don't fire in the Flash SDK either)

Best,
Greg

Greg Kindel

unread,
May 9, 2016, 8:13:15 PM5/9/16
to Interactive Media Ads SDK
Binny,

Confirmed that the demo page succeeds andI found my mistake.  While the string value is "skip" the constant is SKIPPED, I had been using AdEvent.Type.SKIP, which is not defined.  I've updated my sample and it is happy (with above comment about USER_CLOSE not being consistent).   Gets tricky when the -ed suffix is not used consistently on the event names, and even more so when they constants do not match their event.type logging.

Sorry for the distraction --thanks for the help!

Binny Patel (IMA SDK Team)

unread,
May 10, 2016, 10:20:33 AM5/10/16
to Interactive Media Ads SDK
Hi Greg,

The USER_CLOSE event will only fire for full-slot ads. You have to use forceNonLinearFullSlot so that the regular ads will be rendered as full-slots, and then you will see the USER_CLOSE, when the ad is skipped. 

Thanks,

Binny Patel
IMA SDK Team

Greg Kindel

unread,
May 13, 2016, 12:11:32 PM5/13/16
to Interactive Media Ads SDK
Thanks.  Got bit by the same bug again with AD_ERROR. Came to a conclusion on this category of bug:

Using constants in JS seems to be more error prone than just using strings. In my own development I have switched to something that will throw an error when there is a typo (which is the point of these in other strictly typed languages). 

Therefore, I recommend that you update your JS style guide to define constants as functions, which would look like AdEvent.AD_ERROR(). Such a call would helpfully throw an error because it should be AdErrorEvent.AD_ERROR().  Just a thought to share --I'll be changing my style as well.

Best Regards,
Greg

Binny Patel (IMA SDK Team)

unread,
May 13, 2016, 2:10:57 PM5/13/16
to Interactive Media Ads SDK
Hi Greg,

Thanks for the recommendation to update JS style guide. I will share that with the rest of my team.

Thanks,

Binny Patel
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages