What the hell??!? (blah, blah of a wannabe alien)
Track AdSense Clicks With Google Analytics
It would be cool if Google automatically tracked AdSense clicks into Google Analytics… But until they do, here’s a little bit of JavaScript code you can use to do it. You can then setup an AdSense click as a “goal” within the Analytics interface.

[code=javascript][/code]
This only works with Internet Explorer because of some limitations/bug with Mozilla. I’m too lazy to code a complicated workaround for other browsers (which would involve running JavaScript code whenever the mouse moves which seems really inefficient to me). Hopefully Mozilla will fix the bug (although it’s been pending for 2 1/2 years now).
Basically it will log an AdSense click as a pageview to a non-existent page (http://www.digitalpoint.com/AdSenseClick in my case).
| Print article | This entry was posted by Shawn on November 18, 2005 at 10:23 am, and is filed under Coding. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
- AdMoolah News and Views » Google Analytics Update
- Google Adsense + Analytics – S-O-S SEO Blog
- DerAdBlog » Blog Archive » AdSense Klicks loggen mit Google Analytics
- Track AdSense Clicks With Google Analytics: Blog Tips at ProBlogger
- Track your adsense clicks » Online Business Tips at Metrobisnis
- ИÑпользуем Google Analytics Ð´Ð»Ñ ÐºÐ»Ð¸ÐºÐ¾Ð² AdSense » Ðу и Ðу! ру
- Entreprenerd » Track Google AdSense Clicks with Google Analytics
- » Seguimiento de Adsense en Analytics
- enrii.blog » Tracking Adsense Clicks with Analytics
- J-Foster.NeT » Newest Adsense Tracking Tool
- ChitikaNews.com » Blog Archive » Track Chitika Ads with Analytics
- Web Analytics Guide » Blog Archive » Track Chitika E-Minimalls!
- Bruk Google Analytics til Ã¥ tracke Adsense klikk – Søkebloggen
- The Google Insider » Track AdSense Clicks Through Analytics
- Google Search blog » Google AdSense Analytics
- Pandeblog 2.1 » links for 2006-04-14
- Make Money with Adsense – Track AdSense Clicks With Google Analytics | Make Money With Adsense
- 100 Top links for Adsense : Top Links : eConsultant
- Track your AdSense Ad Clicks to further maximise on your returns | Chaos Laboratory
- Best tracking tool for adsense – Page 2 – Ad-Sensing.com
- sugestie sistem de verificare si blocare a click-urilor
about 6 years ago
Could this be modified (easily) to work with YPN?
about 6 years ago
Yeah… could work with YPN easily as well.
about 6 years ago
Hi,
Kewl: I have added the urchinTracker( ‘ fake rel URL’ ) to my existing IE clickthrough code so I’ll have the stats in my custom DB and in Google Analytics.
I shall put this up on one mirror almost immediately.
Thanks,
Damon
about 6 years ago
a friend of mine modified the code from Adsense Click Pepper to uses mouse cursor position prior to page unload to help decect AdSense clicks in Firefox.
http://www.seobook.com/analytics/astrack.js
about 6 years ago
Ok, well I tried it with YPN and my stats finally updated and nothing shows.
Is this wrong?
if(elements[i].src.indexOf(‘overture.com’) > -1) {
about 6 years ago
The code would need to be a little different because Yahoo ads don’t set the browser status to “go to whatever”, so I would just take out the logic that tests for it.
about 6 years ago
Well, I’m sure Shawn is right… but it’s Greek to me…hehe. I think he’s talking about removing the “if”, but it’s hard to test something with clicking it or waiting for google to update sats.
If anyone has a working example, I would appreciate seeing it. I would REALLY like to have this to work with YPN.
Thank you.
about 6 years ago
You can test it (make clicks yourself) by changing the AdSense ID to ca-test. Oh wait… that wouldn’t work for YPN… hahaha… no idea what YPN’s test ID is.
about 6 years ago
You are too cool! Thanks!
about 6 years ago
Thanks for the script Shawn! I looked at my stats for the past week and looks like its not accurate comparing with Adsense account – do you know why?
about 6 years ago
Because it doesn’t work with Firefox users (see note about Mozilla bug).
about 6 years ago
from where can I get this blog script? Its so simple and yet very attractive.
about 6 years ago
This is WordPress with a custom template.
about 6 years ago
Strange it is:
elements[i].onfocus = adsense_click;
- aren’t onfocus and onclick mixed here?
about 6 years ago
I need help. Don’t Work!
about 6 years ago
Great.
But I found that it works well for the first click, but when return back to the history page, the following clicks can not be tracked.
Can you tell me how to figure it out?
about 6 years ago
hey thanks! i will try to use this in both of my blogs!
about 6 years ago
I wonder if this works..anyone tried it?
about 6 years ago
Any chance this could easily be modified for adlinks? I think they use “View ads about” instead of “go to”
about 6 years ago
I have Analytics and this is very useful. Thanks.
about 6 years ago
This doesn’t really work all that well. First of all, if someone clicks back, chances are clicks will not register.
And this is not a Firefox bug, the reason it doesn’t work with firefox is “change status text” is off by default.
Options -> Content -> Advanced
Too bad, because this could be used to prevent clickfraud if it worked.
about 6 years ago
Worked great for me for first month or so, but the other day it stopped recording roughly 90% of my clicks. Anybody else seen this? My .js file is on a seperate domain, but this wasn’t a problem before. And help would be great. thanks.
about 6 years ago
Very usefull code Shawn. Been looking for something to help me track adsense clicks. Thanks.
about 5 years ago
Dear All
plz tell how to set up a goal for Adsense in Google Analytics
about 5 years ago
I have a question on what is being tracked as well. We are within 10% of the numbers reported by adsense, but only if we add in the number of hits from the googlebot client. Tracking only the IE hits, it ia much further off. Is that correct? Does the googlebot follow in the adsense links?
about 5 years ago
your script only works with the IE.
Firefox doesn´t support “window.status” for security reasons.
about 5 years ago
It don’t work with firefox
about 5 years ago
Will it work for referrals and search results?
about 5 years ago
If you just want to know how many AdSense clicks you have received you may want to check out the metrics package at performancing.com.
Performancing.com Metrics counts AdSense clicks (incl. adlinks) and it also shows the goal of the clicks in the outbound links page.
Performancing.com Metrics is a pretty complete free statistics package. Not as powerful as Google analytics but it has hourly updates and a faster overview.
about 5 years ago
Just wanted to add my thanks!
about 5 years ago
I am able to track Adsense clicks; however, is there a way to track which page the adsense ad was clicked?
about 5 years ago
Never mind…I found a report that tells me which page the adsense ad was clicked.
about 5 years ago
Im trying to track adsense clicks but Im getting no window.status text appearing in the status bar. Could anyone tell me why this is. If theres no status bar text when I hover I cant get the url of the clickers. It does appear when I hover over other links on the site
about 4 years ago
This no longer works as Google has disabled the URL code. Hover over any AdSense ad and you’ll see it no longer shows the URL needed for this script to track.
Kind regards,
Dave Jackson
http://monetizethis.blogspot.com/
about 4 years ago
This method doesn’t work anymore? Am I right?
about 4 years ago
I try,Seems google changes,click can’t count.
about 4 years ago
i pasted the code in bottom of google ads, then what i need to do in next step, what i will do it generate the clicks?
about 4 years ago
Google still hasn’t added such adsense tracking tool inside the urchin analytics. I hope they do it soon.
about 4 years ago
Thanks, i have found now the modified version also working with firefox and it seems to work perfect
about 4 years ago
Thanks for your help but, if it doesn’t work on Firefox bro’ … i am in trouble. Now, huge people huge firefox …so
is their any way that i can get the same service?
Now time to update it and make it computable for mozilla.
thanks once again
about 4 years ago
I cant understand how to track Adsense clicks
plz any one explain again
about 4 years ago
Thats cool . Thanks fot that.
about 4 years ago
I am able to track Adsense clicks; however, is there a way to track which page the adsense ad was clicked? – the same question from me.
about 4 years ago
Hi..
Do you have a code to track the adsense ad URL/keyword and the page where it is clicked ??
I have a dynamic site, so tracking is difficult
about 4 years ago
Thanks Shawn for this great tip.I think Ad Free Stats
tracking tool will help too.
about 3 years ago
I just tried adding the URL http://pagead2.googlesyndication.com/pagead/ in the goal URL field on the goal set up (using Head Match). Is this going to work for me? It seems like it makes sense.
about 3 years ago
It is a nice code shawn even though adsense and analytics is in integration now. They might have read about this in 2005. Today is 2008 and the code is still helpful. Keep it up.
about 3 years ago
Although this post is too old but as i am a newbie in programming its pretty useful for me
Thanks alot
about 3 years ago
Has anyone found the solution for a all in one tracker for both IE and firefox?
about 3 years ago
That is great I will use the script in my website
about 3 years ago
What interests me the most is the geographical location of people who click, and the exact ads (site link) that was clicked, this may give a hint about who needs what and where, always help for targeting and keywording !!
about 3 years ago
It will do work in firefox .
about 2 years ago
Awesome info, and thanks for the php script you provided!
about 2 years ago
Google Analytics is more complex I thoutht. Thanks, I will check it.
about 2 years ago
Four years since the post was made and still the article ROCKS! your awesome man.
BTW thanks for sharing the codes
about 2 years ago
This is exactly what I’ve been looking for, I found the script in another blog as well and the content is quite similar to this (even the comments). Anyway, thank you for sharing
about 1 year ago
What interests me the most is the geographical location of people who click, and the exact ads (site link) that was clicked, this may give a hint about who needs what and where, always help for targeting and keywording !!
about 1 year ago
So does this code now works with firefox or not? Someone said he found an updated version that does, can anyone post a link to it please?