Tracking AdSense Clicks with Javascript?

Discussion in 'JavaScript' started by Waizujin, Aug 27, 2010.

  1. #1
    Does anyone know if there is some way I can setup a javascript script that will send a AJAX request to a PHP script whenever a certain div is clicked?

    Why I want this is so that when someone clicks an adsense ad, it will send a Javascript request letting me know it was clicked and what ad was clicked before it sends it on. I am going to be doing some revenue sharing stuff and this would be really helpful in some special cases.

    If you don't think this is possible, or believe I should do it in a different programming language let me know. Because I know JS can be disabled. If I can't do it in JS, maybe I can do it in PHP. Just need to know if it is possible.
    And as a side note, would this breach AdSense TOS?

    Thanks!
     
    Waizujin, Aug 27, 2010 IP
  2. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #2
    If you don't modify the adsense code or it's behavior you're fine. There are already several attempt at adsense clicks tracking, search for open source code to start your own. Personally I don't use it.
     
    JamesColin, Aug 29, 2010 IP
  3. xcool101Man

    xcool101Man Guest

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the problem is that you need the click event on the links generated by adsense not only on the div and this is in a url that is captured by an iframe
    and cross site scripting prevent you from doing that
    I do not think it can work
     
    xcool101Man, Aug 30, 2010 IP