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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using global.asa to get referral url

Status
Not open for further replies.

Jeremy21b

Technical User
Jul 7, 2002
127
CA
Hello.

I'm tyring to track our online sales to the exact url that brought them to the website. In the past we used a drop down menu on the registration page to ask them the referral. Unfortunately these options were too vague.

So I'm trying to capture the referral URL throuh code. I figured a global.asa would be the best place to place this code. Here is what I tried:

Sub Session_OnStart
Session("referral") = request.servervariables("HTTP_REFERER")
End Sub

I've never used a global.asa, so perhaps some syntax is incorrect. When I try to display the session variable on the next page for testing purposes, the session variable is empty. I've tried it with cookies as well with the same result. It's as if the global.asa variables are not recognizing my domain when they are set. Anyone have any idea what is wrong, or does anyone know another way to accomplish this? Thanks.
 
sounds like either you're caching the page that it's supposed to be displayed on, or, your global isn't firing, ensure it's in the root of your web and secondly IIS is configured properly to support global.asa


[thumbsup2]DreX
aKa - Robert
 
Thanks. Ok I know the problem then. We're redesigning the website, so I have all the new files in a new folder...including the global.asa. So I will have to put the global.asa in the root folder. If I access a file in another folder, will it still run the global.asa file in the root?
 
correct, unless it's a virtual folder and you have the virtual settings to run it's own global

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top