Lost Password?
  • Narrow screen resolution
  • Wide screen resolution
  • Auto width resolution
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
  • green color
Member Area

Web Code

Home arrow Scripts arrow JavaScript arrow Track Adsense clicks in Google Analytics     
Track Adsense clicks in Google Analytics PDF Print E-mail
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('googlesyndication.com') > -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 (875) | Quote this article on your site | Views: 8118

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 )
< Prev   Next >

Popular of Late