Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
I've written an article last year about using Google DFP with AdSense on infinite scroll pages which worked very well and was the basis for a number of my own sites and projects. In the past week however I noticed that GPT, which is the JavaScript library used to create DFP ad slots, started behaving erratically.
Update: Looks like Google have fixed this problem as of 22 March 2017.

The very first thing that was noticeably different was that whenever an ad slot was loaded, the web browser window would scroll down to that ad immediately. This behaviour wasn't there before the 20th of March (version 111) release.

The new behaviour of course broke any infinite scroll page, including my example on GitHub. Because the page was automatically scrolling to the ad slot, it would trigger the infinite scroll content loading event, which would load/create more content and another ad slot. Once that ad slot loaded, the page would scroll to it too, would trigger more content loading, and so on. The video below shows this in action.

If AdSense fallback is not used, there is no scroll to ad being triggered. The video below uses the same ads as Google's own infinite scroll example and there is no automatic scrolling, as it should be and was previously.

I've not figured out any workaround for this yet, if you do, let me know! I've also written a post on DFP help forum which hasn't got any answer so far.


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...