Forum Moderators: DixonJones

Message Too Old, No Replies

grab and hold initial refer without cookies?

could perl/ssi do this for me on the server

         

amznVibe

2:58 am on Dec 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Debated which forum this was suited for but since its specifically dealing with tracking I'll take a shot here.

Is there an easy way to grab the initial refer (in realtime, not logs) when a visitor comes in via ANY page on a site and hold it (on disk?) on the server so that I don't have to bother the user with a cookie?

This would be used for a mini-affiliate program so that if they buy something and "checkout" the initial refer can be given credit for the purchase. Obviously I would want to also store the incoming URL so that some kind of ID# can be passed and will be available as a fallback if the refer is blocked.

I can muck my way through perl if anyone has some code snippets they can point me to, thanks for any help! -aV-

Dreamquick

11:13 am on Dec 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can access the referrer data in real-time using most server-side languages or javascript (I'm an ASP person so I'd user Request.ServerVariables("HTTP_REFERER") to get access to the referring page info, in javascript you have document.referrer which should do something similar - I don't know any PHP so can't suggest the relevant snippet for that).

From there it's simple enough to store it to disk.

However the issue is how you then re-associate that data back to a specific user at a later date without either a permenant cookie, session cookie or some other method of keeping state (ie remembering stuff about a user).

- Tony

amznVibe

2:48 am on Jan 7, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dreamquick, thank's for the thoughtful reply... any idea how microsoft does this on their msn message groups? they track who you are without cookies, and there is nothing appended to the URL like a php session... it has to be a "passport" server-side thing, then again I would want an apache based solution so however they do it wouldn't be too useful to me...

hmm, can PHP track a session without appending the URL?

ibbie

7:38 pm on Feb 7, 2003 (gmt 0)



an example in perl: [ibbie.sourceforge.net...]

click on the 'view source' link to see the source code of the cgi program.

an example in php:


<?php
$var = $_SERVER["HTTP_REFERER"];

print "your referrer is $var";
?>

in ssi/shtml:


<!--#if expr="${HTTP_REFERER}" -->
your came here from <!--#echo var="HTTP_REFERER" -->
<!--#endif -->

hope this helps. (:

jatar_k

8:02 pm on Feb 7, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld ibbie,

amznVibe in php you can use a transparent session id as well.
On this page
[php.net...]
look for session.use_trans_sid

if you don't use a cookie/session and drop the info a db there needs to be a way to tie the data to the user.