Replacing blocked ads with house ads — Google DFP edition
|This post has been submitted by Webcomics.com member JJ Sandee, creator of Cult of Bob.|
A while ago Brad was asking on Twitter about being able to catch Google DFP being blocked by the likes of Ghostery and other Ad Blockers. When blockers are present, he’d like to replace the ads with house ads promoting the site, his own work, books, etc.
(By the way, if you’re using Google AdSense instead of DFP, we’re going to show you how to adjust the code for your own use, so read all the way to the end!)
Ghostery primarily blocks ads because it prevents content being loaded from different domains. Since most ad networks are located on different domains, they get blocked. The main challenge here was that each container got a unique ID that changes, which makes it harder to change for it.