Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

the referring url question 1

Status
Not open for further replies.

FALCONSEYE

Programmer
Joined
Jul 30, 2004
Messages
1,158
Location
US
thanks for the help in advance. i have a problem with recording the referring urls. in our log tables, we have %60~%67 null referring urls. i have the following code:

document.write("referring url by javascript:"+document.referrer);

what happens is when a user opens up a browser the home page is loaded. if i type in my site's url or click the link from one of the favorites, the document.referrer variable is null. is there a way to capture this information via AJAX or another way ?
thanks again...

 
AFAIK, that is correct behaviour. Because the user has not reached your page via any other site (i.e. they have gone "direct" by typing in the URL or using favourites), then the referrer SHOULD be blank.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
So you want to find the referrer by a variable other than the referrer variable?

-kaht

How much you wanna make a bet I can throw a football over them mountains?
sheepico.jpg
 
From what I have read, some browsers also have the ability to block the referrer info from being passed.



Paranoid? ME?? WHO WANTS TO KNOW????
 
that's true. you can also block the referrer with antispyware programs and such. my intention over here is to get as much referrers as possible. i just need to get a better ratio : 67% unknowns vs 33% for the month of September. if i can make this at least 40%unknown, 60%known that will be enough.

 
You will probably not be able to access the urls in the history unless they already are in your domain. This is for privacy reasons.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Give this up. You are capturing the referrers. There is no other way. You will just get frustrated and make no progress.

The HTTP description documents the referrer as optional as well... and I'm seeing more and more visitors with blocked referrers (or lots of xxxxxxxxxxxx in the referrer details).

Here's hoping you save your time!

Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Surely everyone is missing the point? The point is that there IS NO referrer for URLs visited directly, so there IS NO way of getting something that does not exist.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
i know there is nothing in the referrer. the ecomm department uses an application called click trax. somehow, the click trax application shows the referring urls magically. perhaps, they are pulling stuff out of a hat or something. how is that possible since there is no referrer?
my opinion was if the document.referrer is null look at the history object. does anyone know a good ajax documentation online? although i googled, i keep getting some code snipplets as search results.thanx

 
You cannot access the history object. Not even read only. You just can't do it... it would be a security risk to do so.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Click Trax probably tracks the referring url by passing it from the original page as a direct parameter. That would be a little harder to block.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Your website statistics, provided by your hosting company, will have all that information that's available for you. Check with them to see how to get that yourself and figure out what means what.

Lee
 
by passing it from the original page as a direct parameter.

Let me make it as easy to understand as I possibly can:

Code:
<a href="newPage.html?thePageYouHaveJustComeFrom=<%=Some Server Side Code To Print Out The Current Pages URL Goes Here%>">link text</a>

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top