Goal : To write a cookie which stores the referring website and then writes this referrer into an order form if the visitor orders a service.
Reason : To improve advertising effectivenss.
1. Get the cookie to check if it already exists and not write anything if it does (so it only ever writes the first time someone visits).
2. Get another page to read the cookie.
var exp = new Date()
var oneYearFromNow = exp.getTime() + (365 * 24 * 60 * 60 * 1000)
var qasdf = document.referrer
document.cookie = "referred by " + escape( document.referrer ) + "; expires=" + exp.toGMTString();
Could anyone assist me with this please?
Having defined cookie_name, why not use it?
Cookies (values) are not supposed to contain spaces, commas, or semicolons, so maybe
document.cookie = cookie_name + "=" + escape("referred by " + document.referrer ...
Also, there is no need for putting Newbie in the post title.