Track Adsense clicks in Google Analytics
Written by Administrator   
Thursday, 18 October 2007

 With this script you can track your Adsense clicks in Google Analytics. You can tell where you got the click from, what was the site that refer the user who clicks and other cool stuff.


// Put this at the bottom of the page (after the last AdSense block)
function adsense_click() { if(window.status.indexOf('go to') == 0) {
urchinTracker ('/AdSenseClick'); }
} var elements;
if(document.getElementsByTagName) { elements =
} else if (document.body.all) { elements =
} else { elements = Array();
} for(var i = 0; i < elements.length; i++) {
if(elements[i].src.indexOf('') > -1) {
elements[i].onfocus = adsense_click; }


 Just put this script at the end of the page (after the last Adsense code).
After doing that go to Google Analytics and create a new "goal". The name of the goal can be "AdSenseClick" (without brackets) and the URL of the goal should be "/AdSenseClick" (without brackets).

Related Items:

Write Comment

Code:* Code

Add as favourites (881) | Quote this article on your site | Views: 8142

Comments (1)
1. 14-03-2008 15:39
Do you have screen captures of how the results look in google analytics? Thanks.
Written by Jessica (Guest)
Last Updated ( Thursday, 18 October 2007 )