document.referrer question for tracking hits and visits

Discussion in 'Javascript' started by goks, May 25, 2004.

  1. goks

    goks Guest

    I'm using document.referrer method for tracking visits on my site. But it
    seems that, when someone finds my site with google, this method returns
    only:
    "google.com/search?q=xxxxx" (good)
    or
    "google.com/search?hl=en" (bad)
    or
    "google.com/search?sourceid=navclient" (bad)

    That meens, it returns only first parameter sent to google. "hl" defines
    language and is used very often. BUT I want to see key words also (variable
    "q").
    Has anyone noticed that... or have any idea for the solution?

    Thanks

    Goran
     
    goks, May 25, 2004
    #1
    1. Advertising

  2. goks

    kaeli Guest

    In article <c906v8$jp$>,
    enlightened us with...
    >
    > That meens, it returns only first parameter sent to google. "hl" defines
    > language and is used very often. BUT I want to see key words also (variable
    > "q").
    > Has anyone noticed that... or have any idea for the solution?
    >


    My web server has a control panel that tracks all of that and more.
    Check with your web host to see if they have a stats area.

    document.referrer is not reliable.

    --
    --
    ~kaeli~
    Press any key...NO, NO, NO, NOT THAT ONE!!!!!!
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, May 25, 2004
    #2
    1. Advertising

  3. goks

    kaeli Guest

    In article <1noyy94y08z7c.noklp04u3oj3$>,
    d enlightened us with...
    > >
    > > document.referrer is not reliable.

    >
    > I thought that is where the server got
    > the information for the logs ..they will
    > be the same information won't they?
    >
    >


    Yes and no. Users (well, script kiddie types with nothing better to do)
    can modify the referrer if you rely on script. They can't change what
    the server sent in the headers. The OP was talking about getting the
    values from javascript.

    I meant that statement as an aside, though. I was mostly adressing the
    fact that my host server tracks things like keywords used to get to your
    site. The OP said
    "That meens, it returns only first parameter sent to google. "hl"
    defines language and is used very often. BUT I want to see key words
    also (variable"q")."

    My server tracks keywords used from all the major search engines.
    Whether it uses referrer or not is a black box for me. I just get the
    stats. And I get tons of stats. A lot of paid hosts have stats as part
    of the package. It's nice.

    --
    --
    ~kaeli~
    If that phone was up your a$$, maybe you could drive a
    little better!
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, May 25, 2004
    #3
  4. goks

    Lee Guest

    goks said:
    >
    >I'm using document.referrer method for tracking visits on my site. But it
    >seems that, when someone finds my site with google, this method returns
    >only:
    >"google.com/search?q=xxxxx" (good)
    >or
    >"google.com/search?hl=en" (bad)
    >or
    >"google.com/search?sourceid=navclient" (bad)


    Is that the full value of document.referrer, or do you do
    some processing to the string that might be inadvertently
    truncating it at the first ampersand?

    As pointed out, though, it's usually much simpler to do
    that sort of tracking with server logs and/or statistics.
     
    Lee, May 25, 2004
    #4
  5. goks

    goks Guest

    "Lee" <> wrote in message
    news:...
    > goks said:
    > >
    > >I'm using document.referrer method for tracking visits on my site. But it
    > >seems that, when someone finds my site with google, this method returns
    > >only:
    > >"google.com/search?q=xxxxx" (good)
    > >or
    > >"google.com/search?hl=en" (bad)
    > >or
    > >"google.com/search?sourceid=navclient" (bad)

    >
    > Is that the full value of document.referrer, or do you do
    > some processing to the string that might be inadvertently
    > truncating it at the first ampersand?


    This is my javascript:
    <script language="JavaScript" type="text/javascript">
    var sRefer = "refer=" + document.referrer;
    var sURL = "&url=" + document.URL;
    document.write("<img src='xxx/counter.asp?" + sRefer + sURL + "' width=1
    height=1 border=0 alt=''>");
    </script>

    Inside ASP:
    var sRefer = "" + Request.QueryString( 'refer' );
    var sPage = "" + Request.QueryString ( 'url' );

    URL is always processed OK.

    > As pointed out, though, it's usually much simpler to do
    > that sort of tracking with server logs and/or statistics.


    The fact is that I have a free web space from my ISP, but it doesn't allow
    any active pages such as ASP or CGI. So I'm using other site with ASP and
    database support to track visits on my noASP site.
     
    goks, May 26, 2004
    #5
  6. goks

    goks Guest

    "kaeli" <> wrote in message
    news:...
    > In article <c906v8$jp$>,
    > enlightened us with...
    > >
    > > That meens, it returns only first parameter sent to google. "hl" defines
    > > language and is used very often. BUT I want to see key words also

    (variable
    > > "q").
    > > Has anyone noticed that... or have any idea for the solution?
    > >

    >
    > My web server has a control panel that tracks all of that and more.
    > Check with your web host to see if they have a stats area.


    Nop. Free web space from my ISP. No ASP no CGI no writing no database...
    that's why I want to track it from the outside. Main reason is fun and
    learning :))

    >
    > document.referrer is not reliable.
    >
    > --
    > --
    > ~kaeli~
    > Press any key...NO, NO, NO, NOT THAT ONE!!!!!!
    > http://www.ipwebdesign.net/wildAtHeart
    > http://www.ipwebdesign.net/kaelisSpace
    >
     
    goks, May 26, 2004
    #6
  7. goks

    goks Guest

    "goks" <> wrote in message
    news:c90m9a$5c6$...
    >
    > "Lee" <> wrote in message
    > news:...
    > > goks said:
    > > >
    > > >I'm using document.referrer method for tracking visits on my site. But

    it
    > > >seems that, when someone finds my site with google, this method returns
    > > >only:
    > > >"google.com/search?q=xxxxx" (good)
    > > >or
    > > >"google.com/search?hl=en" (bad)
    > > >or
    > > >"google.com/search?sourceid=navclient" (bad)

    > >
    > > Is that the full value of document.referrer, or do you do
    > > some processing to the string that might be inadvertently
    > > truncating it at the first ampersand?


    Ha ha :)
    After I posted this I've figured it out... off course.... second ampersand
    is
    taken as another variable. I just have to replace it in variable "refer"
    with something else... like / :))
    Thanks

    > This is my javascript:
    > <script language="JavaScript" type="text/javascript">
    > var sRefer = "refer=" + document.referrer;
    > var sURL = "&url=" + document.URL;
    > document.write("<img src='xxx/counter.asp?" + sRefer + sURL + "' width=1
    > height=1 border=0 alt=''>");
    > </script>
    >
    > Inside ASP:
    > var sRefer = "" + Request.QueryString( 'refer' );
    > var sPage = "" + Request.QueryString ( 'url' );
    >
    > URL is always processed OK.
    >
    > > As pointed out, though, it's usually much simpler to do
    > > that sort of tracking with server logs and/or statistics.

    >
    > The fact is that I have a free web space from my ISP, but it doesn't allow
    > any active pages such as ASP or CGI. So I'm using other site with ASP and
    > database support to track visits on my noASP site.
    >
    >
     
    goks, May 26, 2004
    #7
  8. kaeli wrote:
    > My server tracks keywords used from all the major search engines.
    > Whether it uses referrer or not is a black box for me.


    I don't see any alternative to that.


    PointedEars
     
    Thomas 'PointedEars' Lahn, May 30, 2004
    #8
    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. Alberto

    count visits

    Alberto, Oct 30, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    584
    Scott M.
    Oct 30, 2003
  2. Amil
    Replies:
    2
    Views:
    399
  3. Dos-Man
    Replies:
    5
    Views:
    1,287
    Augustus
    Mar 4, 2004
  4. tshad

    tracking independant hits to page

    tshad, Jul 19, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    340
    tshad
    Jul 20, 2006
  5. Terry

    Tracking page visits

    Terry, Jan 5, 2008, in forum: Javascript
    Replies:
    8
    Views:
    143
    Jeremy J Starcher
    Jan 8, 2008
Loading...

Share This Page