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 (//www.digitalpoint.com/AdSenseClick in my case).
Could this be modified (easily) to work with YPN?
Yeah… could work with YPN easily as well.
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
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
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) {
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.
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.
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.
You are too cool! Thanks!
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?
Because it doesn’t work with Firefox users (see note about Mozilla bug).
from where can I get this blog script? Its so simple and yet very attractive.
This is WordPress with a custom template.
Strange it is:
elements[i].onfocus = adsense_click;
– aren’t onfocus and onclick mixed here?
I need help. Don’t Work!
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?
hey thanks! i will try to use this in both of my blogs!
I wonder if this works..anyone tried it?
Any chance this could easily be modified for adlinks? I think they use “View ads about” instead of “go to”
I have Analytics and this is very useful. Thanks.
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.
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.
Very usefull code Shawn. Been looking for something to help me track adsense clicks. Thanks.
Dear All
plz tell how to set up a goal for Adsense in Google Analytics
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?
your script only works with the IE.
Firefox doesn´t support “window.status” for security reasons.
It don’t work with firefox
Will it work for referrals and search results?
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.
Just wanted to add my thanks!
I am able to track Adsense clicks; however, is there a way to track which page the adsense ad was clicked?
Never mind…I found a report that tells me which page the adsense ad was clicked.
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
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/
This method doesn’t work anymore? Am I right?
I try,Seems google changes,click can’t count.
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?
Google still hasn’t added such adsense tracking tool inside the urchin analytics. I hope they do it soon.
Thanks, i have found now the modified version also working with firefox and it seems to work perfect
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
I cant understand how to track Adsense clicks
plz any one explain again
Thats cool . Thanks fot that.
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.
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 🙁
Thanks Shawn for this great tip.I think Ad Free Stats
tracking tool will help too.
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.
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.
Although this post is too old but as i am a newbie in programming its pretty useful for me
Thanks alot
Has anyone found the solution for a all in one tracker for both IE and firefox?
That is great I will use the script in my website
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 !!
It will do work in firefox .
Awesome info, and thanks for the php script you provided!
Google Analytics is more complex I thoutht. Thanks, I will check it.
Four years since the post was made and still the article ROCKS! your awesome man.
BTW thanks for sharing the codes
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
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 !!
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?