In this post, we will present a simple script to isolate a single ad for debugging purposes. We will assume you’re working with DFP Small Business and WordPress, since these are among the most common systems, however, the general idea should hold for other systems too.
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. There are hundreds of requests in the Network tab and it’s impossible to figure out what’s going wrong.
The simple solution
If you’re using DFP, in many cases you can isolate an problematic ad by using “Preview Creative“. This will load the ad on a blank page. However, there is a big problem with this method. Many advertisers use 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 foolproof 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). You can read all about WordPress Page Templates right here.
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:
If you want, load up this URL and hit “view source”. What you’d done is a created an empty, dedicated page with exactly one ad slot.
Finally, 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. The great part is 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.
A Third Option
If you’re a developer and don’t mind getting your hands dirty, check out Create An Ad Unit Test Page, Part 2 for another way to do this. This is the technique I usually prefer. It’s the most powerful method, but requires setting up a web server on your local computer, which is way more hassle than most people can handle.