![]() |
|
|
|
||||||||||
![]() |
|
|
Thread Tools |
|
#1
|
||||
|
||||
|
Track AdSense Clicks With Google Analytics
Here's a clip of JavaScript code that will track AdSense clicks with Google Analytics.
http://www.digitalpoint.com/~shawn/2...analytics.html You can then setup an AdSense click as a "goal" and track how it happened through the funnel process.
__________________
~ Shawn @Twitter Keyword Tracker Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends. |
|
#2
|
|||
|
|||
|
thanks DP
|
|
#3
|
|||
|
|||
|
Great! That's what I've been thinking during half of the day today (I'l posted at WMW. And now I see your code, I think it maybe could be also done to include the URL the click was going to.
The goal for me is to: find when someone click, their ip and the url they have gone to, as the script I have installed does, but track this with Analytics. Howevr, I still need to play with Analytics and do not have time enough. |
|
#4
|
||||
|
||||
|
Yeah, you can easily track the destination URL for clicks if you control the link source (it's a little tricker with AdSense since you can't modify the AdSense link code). All you would have to do is add something like this:
html4strict Code:
__________________
~ Shawn @Twitter Keyword Tracker Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends. |
|
#5
|
|||
|
|||
|
Shawn,
Your code looks like nearly the one and most of us have installed but modified. I'm quite bad at this, but maybe someone can sort this out as I usally do things like that on test-error-test-error mode. What about this? Code:
function adsense_click()
{
if(window.status.indexOf('go to') == 0) {
urchinTracker ('/AdSenseClick/' +
escape(window.status.substring(6)););
}
}
|
|
#6
|
||||
|
||||
|
Yeah, that would work if you want to know the specific URL people clicked through to.
__________________
~ Shawn @Twitter Keyword Tracker Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends. |
|
#7
|
||||
|
||||
|
Ok, the only part I don't get is how to configure analytics to use this as a goal?
|
|
#8
|
|||
|
|||
|
Cool, I'll see how to go now.
You are great man. This saved me a lot of time and also will help to have some better stats. My adsense tracking right now was to basic. |
|
#9
|
|||
|
|||
|
Log in and when you see your site URL on the first page, click on edit.
You'll see "Goals" there. It's pretty easy, but I need to test before to see how to do a group which has all the adsense clicks, to later on look to url's clicked. |
|
#10
|
||||
|
||||
|
Quote:
|
|
#11
|
|||
|
|||
|
Not tested but I think: /Adsense/ or http://www.yourdomainhere.tld/Adsense/ will work.
(I was looking now at Shawn's blog, you MUST SEE the ping-pong matrix )
|
|
#12
|
||||
|
||||
|
The goal defined for my site is http://www.digitalpoint.com/AdSenseClick
Unless you changed the JavaScript code, it would be http://yourdomain/AdSenseClick for your site.
__________________
~ Shawn @Twitter Keyword Tracker Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends. |
|
#13
|
|||
|
|||
|
That's good to know, thanks.
Do you know if we are able to put everything below a folder as a Goal? |
|
#14
|
||||
|
||||
|
Very nice shawn... how big of a hassle is getting it to work with mozilla?
Not asking you to do it, and you said it is a big pain.. I am just curious as to the scope. |
|
#15
|
||||
|
||||
|
It's a BIG hassle... basically you need to be firing JS events every second or so to see if the mouse is hovering over AdSense and then the URL changes. The main problem is there is a Mozilla bug where you can't attach an onfocus event to an iframe...
https://bugzilla.mozilla.org/show_bug.cgi?id=131784
__________________
~ Shawn @Twitter Keyword Tracker Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends. |
|
#16
|
||||
|
||||
|
Ah okay.. Well I have installed the script on one of my sites to test it out. Appreciate you getting it written.
|
|
#17
|
|||
|
|||
|
so all you do is take the code and put it in the body of your page and then go set a goal with the url of the page that the code is on? i have no technical background so i may be confused
__________________
Bluetooth Technology | |
|
#18
|
||||
|
||||
|
Indeed...
Shawn, I'd buy you a round if we were at the bar right now... |
|
#19
|
|||
|
|||
|
Thank you for this useful code, Shawn! I will try this on my site
|
|
#20
|
||||
|
||||
|
Have anyone figured out how to modify the code to work with YPN? I wish I was a programer
![]() Shawn said: "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." |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| clicks on ads vs. adsense registered clicks | ghacks | Reporting & Stats | 17 | Feb 6th 2007 7:20 pm |
| Google Analytics - What's in it for them? | stephenmunday | Google Analytics | 9 | Oct 9th 2006 11:57 pm |
| Anyone figure out how to track adsense with the Google stats? | mopacfan | Traffic Analysis | 8 | Nov 18th 2005 12:35 pm |
| Google Analytics Down Already? | prowess | Google Analytics | 15 | Nov 17th 2005 2:36 pm |
| Tracking Google Adsense Clicks | daboss | Reporting & Stats | 9 | Jan 11th 2005 12:41 am |