473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Referrer tracking

AJ
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
Jul 17 '05 #1
1 1919
*** 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
--
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ryann | last post by:
Hello. I had a strange entry in my referrer logs. The http-referrer reported that the user came from another site. But the file it claimed to come from a pdf file. I followed the link back and...
9
by: goks | last post by:
I'm using document.referrer method for tracking visits on my site. But it seems that, when someone finds my site with google, this method returns only: "google.com/search?q=xxxxx" (good) or...
1
by: kuok benny | last post by:
Hi, I am trying to use the document.referrer to get the referrer of my home page. Occationally, I get the value of 'blockedReferrer'. Actually how this happen, how the client blocked the...
1
by: brett | last post by:
When I use this code: <select name="status" onChange = "location.href=this.options.value"> <option value="mypage.htm">Select View</option> </select> I don't have a referrer. When I click an...
2
by: Goober | last post by:
I have to determine the document.referrer of the individual coming to my site. I want to send everyone not coming from one of those sites to an alternate location (The names below are just used as...
1
by: Mike Dee | last post by:
Hi All - I'm having a strange problem I'm wondering if anyone can shed some light on. When I use ASP or ASP.NET code to get the referrer information from the server side, it comes back as null. ...
2
by: Fernando Rodríguez | last post by:
Hi, Is there a way to turn the document.referrer string into a Location like object, so I can extrac the domain and other parts of it? Thansk
5
by: Nospam | last post by:
does anyone know if there is anything wrong with this code? <SCRIPT LANGUAGE="JavaScript">document.referrer.indexOf("http://www.example.com") != -1){ ...
1
by: Nospam | last post by:
I have a site http://www.example.com, and I want to link to an article on another site http://www.example2.com, how would I use the site http://www.example.com , as a referrer to the article on the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.