« 5 questions with YPN's David Zito | Main | ScienceDaily.com is the latest AdSense case study »

August 24, 2005

The AdSense for Search keyword tracking workaround

Since I talked about the new "Top Queries" report for AdSense for Search (AFS), I have had people asking me about how to implement the logo workaround I discussed, so all searches can be tracked (beyond the top 25 as well as single searches).

Here are the instructions on how to start tracking, and how to extract the data you need to get those keywords.

First, you need to create a custom logo, with these specifications:

Logo dimensions are limited to 50 pixels by 50 pixels for logos that are placed above the search box, and 100 pixels by 100 pixels for logos placed to the left of the search box. Any images that exceed these limits will be scaled. Supported file types are: JPG, GIF, PNG.

This image should have a unique filename that is used only for AFS.

Once you have created it, login to your AdSense account and in the "AdSense for Search" tab, click "Styles". You can enter in your custom logo as well as your logo URL link into the appropriate fields. Then save the palette and generate a new AFS code in the "Search Code" link. Replace or add the javascript where you would like the AFS box to appear.

Then, you will need to go log hunting to extract the search information. The easiest thing is to find all the referrals for your AFS logo - I used googlelogo.gif in the graphics directory as an example below - which will show you the horrendously long URL which has your keywords hidden in it (I have bolded the keywords below, so you can spot them a bit easier).

"GET /graphics/googlelogo.gif HTTP/1.1" 200 "http://www.google.com/custom?domains=www.example.com%3Bwww.example2.com&q=green+widgets&sa=Search&sitesearch=+www.example.com&client=pub-000000000000000&forid=1&channel=000000&ie=ISO-8859-1&oe=ISO-8859-1&safe=active&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23FFFFFF%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3AFFFFF0%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BLH%3A47%3BLW%3A330%3BL%3Ahttp%3A%2F%2Fwww.example.com%2Fgraphics%2Fgooglelogo.gif%3BS%3Ahttp%3A%2F%2Fwww.example.com%3BFORID%3A1%3B&hl=en"

Most of that code is for how the search results page appears to the visitor. Another part worth noting is the "domains=www.example.com%3Bwww.example2.com" which tells you the visitor was searching two of your specified domains.

It is not the easiest or prettiest way to get specifics on all the searches performed, but it works ;)

Posted by Jenstar at August 24, 2005 09:06 PM

Trackback Pings

TrackBack URL for this entry:


Hm, that get me to an more interesting idea. You could use a little PHP-Script as logo which first logged the keywords with PHP into an MySql-Database and then is displaying the logo. But I donĀ“t know what the Google-ToS is saying about that.

Posted by: Jojo at August 26, 2005 06:43 AM

Post a comment

Remember Me?