Referrer tracking

This is a discussion on Referrer tracking within the PHP Language forums, part of the PHP Programming Forums category; Hi all I've just written a VERY simple shopping cart system for my own joy and edification as much ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-03-2004
AJ
 
Posts: n/a
Default Referrer tracking

Hi all

I've just written a VERY simple shopping cart system for my own joy and
edification as much as anything else. Mostly it was an exercise in learning
about sessions but I want to keep adding to it.

What happens at the moment is that it starts a session when the visitor
enters the site. As soon as the visitor adds something to their cart it
adds a row into a table where the session id is used as the unique
identifier in the table. The table also has columns for the product id and
price (joining tables will be my next learning curve)

One of the things I want to be able to do is affiliate tracking. The way I
have it in my head is that there will be an extra column for refid (or
something) so that:

www.whatever.com?refid=1234

will be used. 1234 will then get written to the table when the visitor
starts to add stuff to there cart.

What I need to know is

1. Is this reinventing the wheel? Is there a better way already
2. If the user hits the site and just looks around for a while, how do I
make sure that the refid variable is maintained until they add something to
their cart?

Hope this makes sense.

Andy


Reply With Quote
  #2 (permalink)  
Old 06-03-2004
Alvaro G Vicario
 
Posts: n/a
Default Re: Referrer tracking

*** AJ wrote/escribió (Thu, 3 Jun 2004 16:06:33 +0000 (UTC)):
> 2. If the user hits the site and just looks around for a while, how do I
> make sure that the refid variable is maintained until they add something to
> their cart?


I normally have an enter page that creates a cookie and then redirects to
site home page. When adding items to cart I check the referrer cookie. The
cookie can expire as soon as visitor closes browser or can be kept for some
days: that depends on your referrers policy.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:25 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0