This simple WordPress script can isolate a single ad for debugging purposes. We will assume you’re working with DFP Small Business, but the script could be modified for other ad servers.
What is the problem?
There is something wrong with one of your ads. Maybe it is loading slowly. Maybe it is showing inappropriate content. Maybe it is breaking outside of its box. Unfortunately, there are 3 other ads on the page, and a video player, and a content recommendation widget, and a dozen other trackers and scripts. It’s impossible to figure out what’s going wrong.
The simple solution
If you’re using DFP, in many cases you can isolate a problematic ad by using “Preview Creative”. This will load the ad on a blank page. The problem with this method is that many advertisers do domain detection. The preview appears to come from a different domain than your main site and the advertiser shows a blank or an AdSense ad instead of their normal creative. You can also preview the creative on an existing page of the site, but then you’re back to square one because other ads will be loaded too.
What you need is a very simple page, served from the correct domain, with all the necessary ad code. The process is a little complicated, but the results are worth it.
The better solution
First, download this chunk of code. Save it in your WordPress theme, using a filename such as page-ad-test.php. The filename is very important.
Then, in the WordPress Admin menu, create a new page. Give this new page the title “Ad Test”. Note that the title must match the name of the file you just created (except lowercase and with dashes instead of spaces).
Now, figure out your DFP Network ID. This number appears in the URL when you visit DFP. Let’s pretend your Network ID is 0000.
Next, figure out the Ad Unit Code for the slot you’re trying to debug. This is the name that appears under the Inventory tab in DFP. Let’s pretend this unit is named ROS_300x250_ATF.
Finally, figure out the width and height for the slot you’re trying to debug. In this case, 300×250.
Combine these parameters into a URL, such as the following:
Load up this URL and hit “view source”. What you have done is a created an empty, dedicated page with exactly one ad slot.
Use the “Preview Creative” tool and provide this page as the URL. You will get the creative you want, serving off the right domain, without any clutter from other ad units or scripts. Note that this page is universal. If you want to debug a different ad unit, such as ROS_728x90, you can by simply tweaking the URL.
The setup is advanced for non-developers, but very do-able!
It’s absolutely useful to day-to-day debugging of creatives. In addition, I’ve made two big discoveries for clients that I was particularly proud of:
1. I was able to quickly isolate some ads that were loading over 50Mb (yes, megabytes) of video. These are bad UX and simply abusive to users.
2. I was able to track down a rogue 3rd party creative that used an 8 second auto-refresh to earn tons of money for the advertiser while paying a tiny CPM to the publisher.