Welcome New User! ( Create Account | Sign In )
Question

Submitted 353 days ago...

theDoctor

theDoctor

Beginner (14)

Whats up with document.referrer

So my site does some tracking by writing cookies. One to indicate what page was hit first and with document.referrer I set a cookie with where they cam from. The cookies in general work fine most converted visitors come in with a least the first page hit. The problem is that the document.referrer cookie sometimes does not get through. So I know that cookies are not being blocked because I got one, and I know it was not a direct entry cause they went to more then one page and the second page hit should set the referrer cookie to the first page hit. So what I was hoping to find out if document.referrer can be block even when cookies are allowed and if anybody has any clue why this works most of the time and occasionally does not seem to work?

 
 
 
Answers
 

Answer 1 / 5

Submitted 353 days ago...

techie

techie

Authority (223)

Are you seeing this on pages on you directly type in the page on your site? In that case it would set the first page cookie, and probably not set the referrer cookie, because there is none. There is only a referrer if there is a page it came from.

Is your cookies set up to handle tracking if someone went to that page directly?

 

Answer 2 / 5

Submitted 353 days ago...

theDoctor

theDoctor

Beginner (14)

Well not really but every page checks to see if there is a entry cookie and a referrer cookie if one does not exist it writes it. So what I'm seeing is someone hits the homepage gets the homepage cookie, goes to the demo page where they should get the referrer cookie as the homepage but they don't. The lead comes in with a homepage entry cookie and no referrer cookie and I know they followed a link on my site so there should be a referrer cookie.

 

Answer 3 / 5

Submitted 353 days ago...

techie

techie

Authority (223)

Can you reproduce this error, by going from the home page (directly typed in) and then click the link to your demo page.

Just a question to you though. wouldn't it make more sense for tracking purposes to set both of these cookies at once when they first hit your site? Wouldn't you want to know that they typed in your home page directly thus setting home page, and no referrer. Or followed a link to pageA.html on your site and get the referrer from that?

The way you have it. You have a mix of external sites and some internal sites for direct visits in your referrer log.

Also, is the link they are clicking on the home page written with the javascript document.write function, or is this link an ajax call? Because if it is either of these cases, then there would be no referrer.

 

Answer 4 / 5

Submitted 352 days ago...

theDoctor

theDoctor

Beginner (14)

Ok if I "by going from the home page (directly typed in) and then click the link to your demo page. " The cookies work for me. The entry cookie become Hompage and the referrer cookie is set when I click to the demo so it is the homepage as well. If I follow a link in, the cookie works for me too. It has to be a security setting or a strange browser case because I personally can't recreate the missed referrer.

I do set the cookies at the same time but I could make a case for the referrer which sets it to direct entry if there is no referrer, but for now that would not be the case because sometimes there is a referring site I just don't capture it.

Strange.

 

Awarded Answer (What’s This?)

Answer 5 / 5

Submitted 352 days ago...

techie

techie

Authority (223)

Are both the home page and the demo page on the same domain? that might cause problems if they weren't.

You could try debugging it by showing the referrer on the page, and then see if you could figure it out that way.

Make sure you test things in IE and FireFox too. Since they can react differently to things.

 

This Question was awarded 332 days ago therefore you can no longer post an Answer. However you may post a comment below.

 
 

Add A Comment

Email Subscriptions
Author adds clarification
All new responses

Related Questions
 
Congratulations!
techie

techie

Authority (223)

techie answer was awarded and will earn ongoing royalties from this thread.

How This Works?