Track Adsense clicks in Google Analytics

 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.

 

<script
type="text/javascript">
// 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 =
document.body.getElementsByTagName("IFRAME");
} else if (document.body.all) { elements =
document.body.all.tags("IFRAME");
} else { elements = Array();
} for(var i = 0; i < elements.length; i++) {
if(elements[i].src.indexOf('googlesyndication.com') > -1) {
elements[i].onfocus = adsense_click; }
}
</script>

 

 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).