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

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...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...