Javascript tracker and Referrer Tracking?

Discussion in 'JavaScript' started by stimpsy, Mar 27, 2006.

  1. #1
    Hi,

    for the past few weeks, it seems that I get more than usual NoReferrers hits within my referers stats.

    On the website, I also use my own tracker script :

    Here is how I call it :

    if (document.referrer)
    {
    document.write('<'+'img src="http://www.mydomain.com/tracker.php?r=' + escape(document.referrer) + '" style="float:left;" width=1 height=1>');
    }


    tracker.php only tracks down the referer and creates a cookie.

    Could this script interfere somehow with the referers tracking ?

    Did anybody have this problem ?

    Cheers
     
    stimpsy, Mar 27, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    How come you are using Javascript? Why not use PHP, $_SERVER['HTTP_REFERER']. It would probably require a little bit of change in your script, but you could get the referer in the header of your site store it in a variable and use it in your tracking script which you would have to include.
     
    Slapyo, Mar 27, 2006 IP
  3. stimpsy

    stimpsy Well-Known Member

    Messages:
    468
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    138
    #3
    because we use this tracker code on many of our client's website too, and not all are using php behind.
     
    stimpsy, Mar 27, 2006 IP
  4. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Ahhh gotcha. That makes sense. ;)
     
    Slapyo, Mar 27, 2006 IP
  5. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Norton blocks referrer headers by default. I reckon this accounts for quite a few 'no referrer' visitors.
     
    mad4, Mar 28, 2006 IP