ID Tracker | JavaScriptSource

ID Tracker

Ronnie Moore May 19, 2000


Save a visitor's referral ID in a cookie ID on their computer. Then, you can you can access that ID cookie from the rest of your site. Useful to help you pay affiliate commissions or track Web site referrals.

When you first come to this page, it sets your ID cookie to "no id". Click here to reload with our referral ID. (note the ?JSS we added to that link!)


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: idTracker.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Matt,[br /]Due to the limitations of these comments, you will need to submit your question to the [a href=""]JavaScript Forum[/a] for further help.

Lee Nov 7, 2007

Hi,[br /][br /]Im currently trying to set up this script to use for my affiliate program, however it only seems to work if the affiliate ID is entered in the address on the same page as the box and button. however on my site I want the affiliates to direct people to the index page, they then look around, buy - so leave to go to paypal, and are returned to /payment_sucess.html and the referral id from the cookie set on the index page is not loading onto the payment success page. the only way i can get an ID up is to put it into the address bar on this page only. making the index page cookie irelevant. any help would be greatly appreciated.

Matt Lynch Oct 31, 2007