Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > document.referrer question for tracking hits and visits

Reply
Thread Tools

document.referrer question for tracking hits and visits

 
 
goks
Guest
Posts: n/a
 
      05-25-2004
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




 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      05-25-2004
In article <c906v8$jp$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)
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

 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      05-25-2004
In article <1noyy94y08z7c.noklp04u3oj3$(E-Mail Removed)>,
(E-Mail Removed)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

 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      05-25-2004
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.

 
Reply With Quote
 
goks
Guest
Posts: n/a
 
      05-25-2004

"Lee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.


 
Reply With Quote
 
goks
Guest
Posts: n/a
 
      05-25-2004

"kaeli" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In article <c906v8$jp$(E-Mail Removed)>, (E-Mail Removed)
> 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
>



 
Reply With Quote
 
goks
Guest
Posts: n/a
 
      05-26-2004

"goks" <(E-Mail Removed)> wrote in message
news:c90m9a$5c6$(E-Mail Removed)...
>
> "Lee" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
>
>




 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-30-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tracking page visits Terry Javascript 8 01-08-2008 07:05 PM
tracking independant hits to page tshad ASP .Net 2 07-20-2006 05:43 PM
Tracking hits...bots vs. real users Amil ASP .Net 2 01-14-2005 07:49 PM
Number of hits divided by "robot hits" Dos-Man HTML 5 03-04-2004 07:56 AM
Mozilla Tips reaches 100 Tips and 90,000 Visits Cornelius Fichtner Firefox 0 12-18-2003 11:50 PM



Advertisments