Tracking script for AdSense

Discussion in 'HTML' started by Noël®, Oct 23, 2004.

  1. Noël®

    Noël® Guest

    Hi all,

    I'm using the following code to track clicks on one of my sites that is
    running AdSense.

    <script type="text/javascript"><!--

    function hit() {
    window.focus();
    if (window.status) {
    img = new Image();
    img.src = 'log.cfm?ref=' + escape(document.location) + '&link=' +
    escape(window.status);
    };
    };
    document.getElementById("google_ads_frame").onfocus = hit;

    //--></script>

    All is working fine in IE (The log.cfm file keeps track of everything), but
    NOT in Opera and Mozilla Firfox (and I guess some other browsers)

    The problem is I think the "onFocus" event handler.

    Any suggestions on how I can get this small bit of code to work with more
    browsers?

    Small note. The code you see is placed right after the AdSense code itself
    and there are no changes made in the AdSense code itself.

    Noel
    Noël®, Oct 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Faruk Malik
    Replies:
    2
    Views:
    416
    Steve C. Orr [MVP, MCSD]
    Feb 17, 2005
  2. Trevor

    Google Announces Adsense

    Trevor, Jun 24, 2003, in forum: HTML
    Replies:
    5
    Views:
    929
    Jerry Muelver
    Jun 26, 2003
  3. John D.

    Google - adsense

    John D., May 14, 2004, in forum: HTML
    Replies:
    6
    Views:
    495
    Denis McMahon
    Dec 30, 2012
  4. Looking
    Replies:
    15
    Views:
    981
  5. Adsense within script

    , Apr 24, 2006, in forum: Javascript
    Replies:
    6
    Views:
    104
    Thomas 'PointedEars' Lahn
    Apr 28, 2006
Loading...

Share This Page