jqueryadsensegoogle-dfpadsense-api

How to determine the ad rendered by google publisher tags


Essentially I would like to add some classes to parent elements of a rendered slot depending on the size of ad returned. Is this possible? I see that there is a googletag.events.SlotRenderEndedEvent that gives me access to the slot. But from there I am not sure how to determine the element that the slot renders to.

I've done some bookkeeping and have access to the originally defined slots, but comparing them doesn't seem to work.

Any ideas?


Solution

  • They finally exposed a method to get this information: getSlotElementId