473,507 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.referrer question for tracking hits and visits

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
9 3045
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
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
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
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

"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

"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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
13195
by: Hugo Sousa | last post by:
Hello, I have a page that cannot be accessed by typing is url. It should only be accessed by a link in another web page. The following scrip works fine: <script> <!-- var validreferrals=new...
1
2970
by: kuok benny | last post by:
Hi, I am trying to use the document.referrer to get the referrer of my home page. Occationally, I get the value of 'blockedReferrer'. Actually how this happen, how the client blocked the...
9
14372
by: Frances Del Rio | last post by:
if I put alert(document.referrer) in code of a file that was linked from another it returns blank... pls, need to get document.referrer, don't why it's not working... read up on oreilly, don't...
2
2344
by: Goober | last post by:
I have to determine the document.referrer of the individual coming to my site. I want to send everyone not coming from one of those sites to an alternate location (The names below are just used as...
2
10258
by: X l e c t r i c | last post by:
Hi, I'm trying to put the last URL visited to a text input using history.previous for WebTV (because I can't get document.referrer to work with WebTV) and document.referrer for PC. This is for...
1
2752
by: Mike Dee | last post by:
Hi All - I'm having a strange problem I'm wondering if anyone can shed some light on. When I use ASP or ASP.NET code to get the referrer information from the server side, it comes back as null. ...
5
10994
by: Nospam | last post by:
does anyone know if there is anything wrong with this code? <SCRIPT LANGUAGE="JavaScript">document.referrer.indexOf("http://www.example.com") != -1){ ...
1
2125
by: gocre8 | last post by:
hope someone can advise! . . . i'm using this code... <SCRIPT LANGUAGE="JavaScript"> document.write("<INPUT type=hidden NAME=referrer VALUE=" + 'document.referrer' + ">"); </SCRIPT> to...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.