Yes. Charles is a web debugging proxy tool which can record or analyze the HTTP (or HTTPS) calls going from your PC to internet. This is a basic Charles proxy tutorial. Few of the other famous free ones are… Fiddler, Wireshark & Burp which are equally good. We are using Charles proxy here and you may use any other tools you feel comfortable with.
What do they do and why here?
These tools act as an intermediary, capturing the traffic going from browser to internet and back. In ad serving, it help us in breaking down the ad requests that the browser send to Double Click Ad Server and the response DFP server sends back.
Lets dive in
Lets start this Charles proxy tutorial with GPT here.
If you are using GPT tags on your page then the requests will be sent under http://pubads.g.doubleclick.net in gampad as illustrated below for this test page. You can record a session of the test page using Charles for checking this out.
The Google GPT(Google Publisher Tags) ad request will be a GET request having multiple parameters like for eg. prev_iu_szs which shows the ad request sizes, iu_parts showing the ad unit name etc.
PS: The GPT ad request parameters I describe here are something which I found while troubleshooting/research and are only to be used as a reference while debugging ad delivery. Refer the above image to find these.
correlator : It’s used in cache busting and is auto generated by DFP JS libraries. For ad requests coming from a single page, the correlator value must be same. You may check out this awesome post by Adam regarding cache busting in DFP.
iu_parts : Shows the network ID followed by the ad unit name or the hierarchy in case of a child ad unit.
prev_iu_szs : The ad request sizes. In SRA, you can see multiple ad request sizes separated by comma. You can check it out by recording a session for this SRA test page.
scp : The slot level targeting key value pairs. Record a session for this test page to see the custom parameter planes=boeing787 for the 1st ad request and planes=boeing757 for the 2nd ad request.
cust_params : Page level targeting key-value pairs. Check this test page session to see the page level custom parameter design=french for both the ad requests.
The ad requests response can be seen under the response tab and it will list the results that DFP returned to the browser. Let’s check out what surprise it holds in store for us.
DFP ad response parameters:
Google-LineItem-Id : ID of the winning Line Item and multiple IDs if its an SRA(Single Request Architecture) ad request.
Google-Creative-Id : The winning DFP creative ID from that Line Item and multiple IDs if its an SRA.
When nothing’s going right & everything’s a mess…:
Google-LineItem-Id is -1 : Tells that DFP returned an AdSense or AdExchange line item.
Google-LineItem-Id is -2 : Means DFP didn’t return an ad a.k.a an Unfilled Impression. The ad selection process didn’t return a Line Item.