The exact moment of GPT "viewability" vs slotRenderEnded event fired

2k Views Asked by At

I'm working on some functionality that will determine a GPT ad's viewability on a page, and I'm using the event of "slotRenderEnded" for each ad to determine if an ad is indeed "viewable" at the time.

Is this an accurate/proper measure of an ad's ability to be viewable? Sometimes it seems that this event fires, but then I can't actually see the image on the site quite yet, sometimes until ~300ms later. Also, the slotVisibilityChanged event doesn't seem to always firem, e.g. if you don't scroll the page at all.

So again, my main question: is the slotRenderEnded event firing enough for me to assume that the ad on the page is able to be viewable?

1

There are 1 best solutions below

0
On

You should listen for the ImpressionViewableEvent which will fire when the Active View criteria has been met.

googletag.pubads().addEventListener('impressionViewable', function(e) {
    console.log("Active View criteria has been met.", e);
});