By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,807 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

document.referrer question for tracking hits and visits

P: n/a
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


Jul 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
In article <c9*********@bagan.srce.hr>, ja*********@yahoo.com
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

Jul 23 '05 #2

P: n/a
On Tue, 25 May 2004 15:19:11 -0500, kaeli wrote:
In article, ja*********@yahoo.com 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
.... 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.


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

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #3

P: n/a
In article <1n*****************************@40tude.net>,
Se********@www.invalid 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

Jul 23 '05 #4

P: n/a
Lee
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.

Jul 23 '05 #5

P: n/a

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <c9*********@bagan.srce.hr>, ja*********@yahoo.com
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

Jul 23 '05 #6

P: n/a

"Lee" <RE**************@cox.net> wrote in message
news:c9*********@drn.newsguy.com...
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.
Jul 23 '05 #7

P: n/a

"goks" <ja*********@yahoo.com> wrote in message
news:c9**********@bagan.srce.hr...

"Lee" <RE**************@cox.net> wrote in message
news:c9*********@drn.newsguy.com...
goks said:

I'm using document.referrer method for tracking visits on my site. But itseems 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.


Jul 23 '05 #8

P: n/a
On Tue, 25 May 2004 15:53:40 -0500, kaeli wrote:
In article <1n*****************************@40tude.net>,
Se********@www.invalid enlightened us with...

document.referrer is not reliable.
I thought that is where the server got
the information for the logs

.... Yes and no. Users (well, script kiddie types with nothing better to do)
can modify the referrer if you rely on script.


I see what you mean now, thanks..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #9

P: n/a
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
Jul 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.