document.referrer question for tracking hits and visits

G

goks

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
 
K

kaeli

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.

--
 
K

kaeli

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
 
L

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.
 
G

goks

Lee said:
goks said:

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.
 
G

goks

kaeli said:
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 :))
 
G

goks

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
 
T

Thomas 'PointedEars' Lahn

kaeli said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top