How to track where a buying customer came from..???
Posted on 2006-06-16
I've got a shopping cart setup that when a person completes an order it updates the database and sets the lead source in the invoice to Web Page (this is how my client has it setup.) I'd like to be more specific with that and see where the person came from: eBay, BrokerBin, PriceGrabber, etc. I know I can use Request.ServerVariables("HTTP_REFERRER") to grab a referring URL, but I'm confused as to where I put this and how I store it.
I was thinking I could store the referring URL in a session variable and then populate a field in the database with this along with the rest of the info that gets inserted. The problem is...how do I store this and make sure the correct URL gets inserted?
If I store the URL in a session variable I'd have to add that to every page that the person could possibly enter the site with. But then if they go to another page on my own site doesn't the referring URL now become the site itself? So as soon as they load another page that sets the session it'll set to its own domain and overwrite the actual domain the person came from.
Am I missing something here? How does one go about doing this? Any information would be greatly appreciated. Thanks!