473,804 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1936
*** 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
2335
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 as a PDF file it clearly doesn't have a link back to our side. Under what circumstances might this happen? Thanks in advance!
9
3098
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 "google.com/search?hl=en" (bad) or "google.com/search?sourceid=navclient" (bad) That meens, it returns only first parameter sent to google. "hl" defines
1
2998
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 function of document.referrer. I just want to verify how this could be done within the browser e.g. IE, Netcape and so on... what Internet option have them activate or not activate to make me to have the value 'blockedReferrer'? Thanks in advance.
1
1740
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 anchor tag link, the resulting page does have a referrer. How can I get a referrer using the above JS?
2
2385
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 examples). I want to match on one of those names anywhere in the document.referrer. In the main program I call a subroutine like this: <script LANGUAGE="javascript" SRC="../js/redirect.js"></script> <body leftmargin="0" rightmargin="0"...
1
2771
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. However in these same cases document.referrer returns the valid referrer. What could cause this? In other words, with the following line: ref = Request.ServerVariables("HTTP_REFERER") (or its ASP.NET equivalent)
2
3190
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
11026
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){ document.write("http://www.example.com/image1.jpg")} </SCRIPT> ?
1
1722
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 second site http://www.example2.com using javascript?
0
9715
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10354
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.