I need help with referer ID tracking

E

Edwin Hannan

I am totally new to this aspect of the web

I use FP2000 and 2003

I create a link to my website from another website, and add the ?id=kf to
the url and have the following code on my index page
I have a hidden form on the page and a field to take the id
The visitor duly clicks the link and arrives at my site, a cookie is created
on his/her machine (hopefully:)

Now I am stuck, I had a 'Read Cookie' function on a appliction form page
hoping to read in the cookie value to a hidden form field so that it would
be returned with the form results...No such luck.I am missing something
fundamental here but cannot see it

Please can some one help me out

cheers

Ed
Edwin Hannan
edwin<<dot>>hannanatATntlworldDOTcom

PS. I need the most simplest method of reading this cookie when the
visitor clicks on another page of the site

************** my hidden form **********************************************
<form name=idform>
<p align="center">
<input type="hidden" name="id">
</p>
</form>

*************** The Javascript That I found on the net
*************************

// Referer ID tracking Code functions - Begin, may be better to reference
this from a .js file
// visitor to this page will have a cookie set with the ID, this needs to be
read from the form
// and emailed back in the form results

function readID() {
var expDays = 90; // number of days the cookie should last
var expDate = new Date();
expDate.setTime(expDate.getTime() + (24 * 60 * 60 * 1000 * expDays));
var id = GetCookie('id');
if (id == null || id == "no id") {
if (location.search.length > 1) id = location.search.substring(1,
location.search.length);
else id = "no id";
if (id != GetCookie('id')) SetCookie('id', id, expDate);
}

// You can change the FORM location below
// where the referral ID is stored on your page
// You then access this element to get the ID
document.idform.id.value = id;

}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

// Referer ID tracking Code functions - END

*************************** Javascript End *******************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top