Igor's Blog
Programming, DIY, Games, Hacks, and Tech

I've written a number of articles about Google DFP in the past, including how to use it on infinite scroll pages and responsive pages. Recently I noticed that DFP has been behaving strangely on some of my sites and used the DFP Publisher Console to try and diagnose the issue. Unfortunately the issue I came across was not something that I could fix (it was in Google's JavaScript), but using the publisher console helped me in making certain of where the problem lied.

Bringing up the console is just a matter of calling the googletag.openConsole() function from the JavaScript console (no need to modify any code!) You can optionally pass the ID of the DIV containing the ad slot if you want to diagnose a specific slot.
 JavaScript
googletag.openConsole(); /* Shows diagnostics for all ad slots */
googletag.openConsole('gurujsonrpc_dfp1'); /* Shows diagnostics for a specific slot */


The console takes a few moment to load, when it does, it appears as a fixed overlay at the bottom of the page. Once the console is loaded all of the ad slots on the page are replaced with diagnostic boxes, which is very handy to see ad slot details quickly. The console shows all loaded ad slots if you didn't pass any parameters to the openConsole() function, otherwise it will only show details of the ad slot that you specified.
dfpdebug_1.png


Clicking over to the 'Page Request' tab of the console will display page load diagnostics. This includes whether your DFP code is tagged correctly or not.
dfpdebug_2.png




The 'Page Request' tab also contains the timeline. This is very handy as it shows what events happened and how long each one took. It can be useful when checking if an ad slot is actually getting rendered or not.
dfpdebug_3.png
dfpdebug_4.png


Jumping back to the 'Ad Slots' tab...each tab has a link to further delivery diagnostics which open in a new window. That page shows detail like which line item was displayed and lets you re-run ad delivery simulation with various parameters set (like country of origin).
dfpdebug_5.png


So there you go, if you're not seeing your ads as expected, pop up the publisher console and see what it reports.

-i

comments powered by Disqus
Other posts you may like...

Recent Blog Posts

A hack to create an uber jar with the Maven Shade Plugin using local jar files

Is it worth it? Apple USB-C Digital Multi AV adapter vs a cheap eBay clone

Running X11 graphical applications after changing to another user using 'sudo su'

How to stop Facebook using ad images as post sharing thumbnails

Picking lists for Atari Lynx capacitor replacement kits

Performance - 2012 Retina MacBook Pro vs 2017 MacBook Pro

Look and feel - 2012 Retina MacBook Pro vs 2017 MacBook Pro

Using math to work out the diameter of hard to reach water cooling pipes

How to get the unreachable shard in the Hinterlands in DragonAge Inquisition

Measy RC12 wireless 2.4Ghz keyboard touchpad review

Recent Galleries

Monument Valley 2 is released and does not disappoint

Space Food - Chocolate Ice Cream with Chocolate Chips

Legeod Star Wars AT-DP kit

DIY spare parts computer build with a RAIDMAX Anura case

Fake 'Lepin' brand Lego packaging

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

My Other Web Sites

Igor and Elise's Travels
Riverside Expressway Cam
300 George St Blogumentary

My Online Tools

UUID to OID Converter
Guru JSON-RPC Tester
Extrudifier Object Designer
Travel ┬ÁBlog

Blogs and Friends

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
Don't forget to
me for more great articles!
Don't show this again