5 tips for debugging your ad setup

Emil Hein
Ad-tech
Published in
4 min readMar 16, 2023

Debugging your ad setup can be tricky. Here are some tips I’ve gathered over the years — mostly for Google ad Manager & header bidding

Photo by Timothy Dykes on Unsplash

When something is wrong, there are usually some checks that can help you spot the mistake. And mistakes will happen, so it's a good idea to get familiar with the debugging process, to spot and fix the error faster.

When debugging ads (or anything for that matter), it’s crucial to have a clear mental map of the problem space to quickly identify where the problem occurs.

My mental map looks roughly like this:

Mental model

1. Check the console

Hard errors will show up in the console. Here you will get the biggest red flags. If some code is breaking or some network requests fails — you can see it here. The console is one of the browser's ways of communicating with a human (mostly developers)

If you want to read more about debugging in the chrome developer tools, you can read this:

2. Activate debugging

Most libraries will have features for debugging, that make it easier to pinpoint if there is anything wrong in their part of the system.

Let’s look at two of the most used libraries and how they can help us debug:

Google ads

When using Google ad manager as your ad server, the library gives you a debugging option, that you can use by inserting the following in the console:

googletag.openConsole()

In practice it looks like this:

Screenshot of the result of using googletag.openConsole()

As you might be able to see on the screenshot above, we get a lot of information from the ad server, by executing this little command.
We get information about the targeting set for the specific page and ad unit, which line item and which creative won, and a lot of other information.
This is a good place to start, if you’re suspecting, something is wrong with your ads. Maybe there not showing, which would also be shown here.

Prebid

Prebid has a similar debugging option. This is triggered by adding something to the website URL

?pbjs_debug=true

In practice it looks like this:

Prebid debugging log

The above will typically show you all the errors Prebid finds. You can typically find errors with sizes, IDs, bidders, or modules here.

3. Investigate the network requests

Its all network requests, so check them!.

All the libraries you use to create your ad requests are in the end just helping you create HTTP(s) requests. This means we can see the result of our configuration on the page, directly in the network tab.

Network request

If you are looking for specific requests you can search for the following:
client-side: “openrtb
Server-side: “Auction
Google ad server: “https://securepubads.g.doubleclick.net

4. Check your ads.txt and CMP

Another common reason for ads not showing correctly is two semi-external things:

1. Your ads.txt, even though you control it yourself, it often gets overseen as it's never placed in the same area as other ad configuration files. Check if all your required entries are listed. If not it should make your ad server deny any demand from the missing partner-entries

2. Your CMP. Your CPM (Consent Management Platform) is responsible for generating a consent string that will be sent to the ad server. This consent string will contain the specific consent your users have given. If something is wrong with the setup of this CMP, it will ripple all the way through to your ad server. If want to manually check if something is wrong with your consent string, you can open the console and write the following (if your CMP supports the tcf api)

__tcfapi('getTCData', 2, function(tcdata, success) {
console.log(tcdata)
})

This will give you something like this:

Tcdata form CMP

5. Check your ad server

If all the above debugging steps have failed, it's time to look into your ad server.
This is ultimately where your ad’s fate is decided. If you look at my mental map, the ad server is the last place I’m usually looking (maybe non-developers will start looking there)
My personal experience is that if the HTTP requests look good, it’s usually something with specific targeting in the ad server. Google Ad manager has many debugging tools within their suite, that should be able to help you identify your issue if it's on the ad-server-side.

// Find the bugs!

--

--

Emil Hein
Ad-tech

Fullstack developer. I enjoy prototyping and testing new services. I like working with JavaScript, Nodejs, AWS and Vue, Browser API's, adtech, Go + more