Working example of HTML5 companion ads and the Video Suite Inspector

504 views
Skip to first unread message

Tim

unread,
Jul 29, 2013, 12:13:10 PM7/29/13
to ima...@googlegroups.com
Hi there,
I'm currently trying to implement companion ads for my HTML5 player. My requirements don't exactly match the examples as laid out in the "Companion Ads" > "Using Google Publisher Tag"

So I decided to look at the Video Suite Inspector to try and see a working example of an HTML5 player with companion ads implemented. There are a couple of discrepancies with the docs and the implementation. Specifically, in the source of the Inspector, there are no googletag.display calls and the pubads() service is not registered on any of the slots that are defined. But with my test ad tag, the companions still seem to work:

http://pubads.g.doubleclick.net/gampad/ads?sz=512x288&iu=/4817/Test_BBCNewsAppiPad&ciu_szs=300x60,300x250&impl=s&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&m_ast=vast&url=[referrer_url]&correlator=[timestamp]

But if I remove the .addService(googletag.pubads()); or .display(slot) from my code, the companions don't show. Is there something that I'm missing?

For background info, I have ima.js and gpt_proxy.js and the video player loaded in an iframe, and I'm using gpt in the top window to define the companion slots, and that definition is triggered by code in the iframe.

I hope that's clear enough!
Thanks,
Tim

Shawn Busolits (IMA SDK Team)

unread,
Jul 29, 2013, 2:07:20 PM7/29/13
to ima...@googlegroups.com
Hey Tim,

If you're loading the SDK in an iframe and gpt.js on the main page, then a standard integration with the proxy should work.  Note that if you're using the proxy, it actually needs to be loaded on the main page with GPT, *not* in the iframe with the SDK.  The implementation in the Video Suite Inspector is actually a bit outdated, so I definitely recommend sticking to the examples provided in the docs instead as much as you can. The code in the Video Suite Inspector gets a bit wonky because it had to be designed to work with both the Flash and HTML5 SDKs, *and* switch back and forth between the two. Give that a shot and let me know if it helps.

Thanks,
Shawn Busolits
IMA SDK Team

Tim

unread,
Jul 30, 2013, 4:51:15 AM7/30/13
to ima...@googlegroups.com
Ah, Thanks, I'll try that out and see if it makes a difference. I can see there's extra clarification in the docs now too ;-)

I'll let you know how I get on.

Cheers
Reply all
Reply to author
Forward
0 new messages