1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.
  2. Better Analytics for WordPress Get It Free

Track AdSense Clicks With Google Analytics

Discussion in 'Google Analytics' started by digitalpoint, Nov 18, 2005.

  1. #1
    digitalpoint, Nov 18, 2005 IP
    tresman likes this.
  2. Dekker

    Dekker Peon

    Messages:
    4,185
    Likes Received:
    286
    Best Answers:
    0
    Trophy Points:
    0
    #2
    thanks DP :)
     
    Dekker, Nov 18, 2005 IP
  3. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #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.
     
    tresman, Nov 18, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    36,812
    Likes Received:
    2,414
    Best Answers:
    418
    Trophy Points:
    710
    Digital Goods:
    29
    #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:

    <a href="http://someplace.com/blah.html" onclick="urchinTracker ('/whateverURLyouWant');">
    HTML:
     
    digitalpoint, Nov 18, 2005 IP
  5. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #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?

    
    function adsense_click()
    {
    	if(window.status.indexOf('go to') == 0) {
    		urchinTracker ('/AdSenseClick/' + 
                                         escape(window.status.substring(6)););
    	}
    }
    
    Code (markup):
    (Yes, I know I just pasted a piece of code, I said I'm quite bad at this but just trying to figure out how to track everything).
     
    tresman, Nov 18, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    36,812
    Likes Received:
    2,414
    Best Answers:
    418
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Yeah, that would work if you want to know the specific URL people clicked through to.
     
    digitalpoint, Nov 18, 2005 IP
  7. mopacfan

    mopacfan Peon

    Messages:
    3,276
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok, the only part I don't get is how to configure analytics to use this as a goal?
     
    mopacfan, Nov 18, 2005 IP
  8. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #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.
     
    tresman, Nov 18, 2005 IP
  9. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #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.
     
    tresman, Nov 18, 2005 IP
  10. mopacfan

    mopacfan Peon

    Messages:
    3,276
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yea, that part is pretty self explanitory.... what is the criteria one should enter as a goal? :confused:
     
    mopacfan, Nov 18, 2005 IP
  11. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #11
    tresman, Nov 18, 2005 IP
  12. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    36,812
    Likes Received:
    2,414
    Best Answers:
    418
    Trophy Points:
    710
    Digital Goods:
    29
    #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.
     
    digitalpoint, Nov 18, 2005 IP
  13. tresman

    tresman Active Member

    Messages:
    235
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    58
    #13
    That's good to know, thanks.

    Do you know if we are able to put everything below a folder as a Goal?
     
    tresman, Nov 18, 2005 IP
  14. aeiouy

    aeiouy Peon

    Messages:
    2,877
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #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.
     
    aeiouy, Nov 18, 2005 IP
  15. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    36,812
    Likes Received:
    2,414
    Best Answers:
    418
    Trophy Points:
    710
    Digital Goods:
    29
    #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
     
    digitalpoint, Nov 18, 2005 IP
    aeiouy likes this.
  16. aeiouy

    aeiouy Peon

    Messages:
    2,877
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Ah okay.. Well I have installed the script on one of my sites to test it out. Appreciate you getting it written.
     
    aeiouy, Nov 18, 2005 IP
  17. shirsc2

    shirsc2 Peon

    Messages:
    439
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #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
     
    shirsc2, Nov 18, 2005 IP
  18. mopacfan

    mopacfan Peon

    Messages:
    3,276
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Indeed...

    Shawn, I'd buy you a round if we were at the bar right now...
     
    mopacfan, Nov 18, 2005 IP
  19. Momo

    Momo Peon

    Messages:
    966
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Thank you for this useful code, Shawn! I will try this on my site :)
     
    Momo, Nov 18, 2005 IP
  20. mjewel

    mjewel Prominent Member

    Messages:
    6,693
    Likes Received:
    513
    Best Answers:
    0
    Trophy Points:
    310
    #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."
     
    mjewel, Nov 22, 2005 IP