SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jul 11, 2002, 19:08 #1
- Join Date
- Apr 2001
- Location
- Halifax, NS, Canada
- Posts
- 58
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Javascript Affiliate Tracking - what am I doing wrong?
Hello,
I am trying to get an affiliate tracking script to work:
<script language="javascript"><!--
var mySearch
mySearch = location.search.substr(1)
var expireDate = new Date
expireDate.setDate(expireDate.getFullYear()+1)
function setCookie() {
document.cookie = "id=" + mySearch + "; expires=" + expireDate.toGMTString()
}
//-->
</script>
For some reason, this is not setting a cookie in my computer when I visit the website liek this: www.crazyhostguy.com?aff250. It should create a cookie for id=aff250. Any ideas what I'm doing wrong? You can see how I've inserted the script here: www.crazyhostguy.com.
Many thanks in advance!
Rob.CrazyHostGuy.com - Multiple domain hosting in one Plan
Hosting Plans starting at $1.95/month
Unlimited Domain Reseller Accounts available
www.crazyhostguy.com
-
Jul 12, 2002, 01:08 #2
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You've got cookies on - right?
Flawless---=| If you're going to buy a pet - get a Shetland Giraffe |=---
-
Jul 12, 2002, 02:58 #3
- Join Date
- Apr 2001
- Location
- Halifax, NS, Canada
- Posts
- 58
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
certainly do!
CrazyHostGuy.com - Multiple domain hosting in one Plan
Hosting Plans starting at $1.95/month
Unlimited Domain Reseller Accounts available
www.crazyhostguy.com
-
Jul 12, 2002, 08:26 #4
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Put a try {} catch(e) {} round it.
Flawless---=| If you're going to buy a pet - get a Shetland Giraffe |=---
-
Jul 12, 2002, 09:02 #5
- Join Date
- Apr 2001
- Location
- Halifax, NS, Canada
- Posts
- 58
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm afraid I don't know what you mean. I am by no means a Javascript programmer.... I just try to implement scripts that I find
In this case, I had someone here at SPF help me with this several months ago.... and it worked on my frames page. Now I've redesigned the site and it no longer works. There are no frames anymore, so I removed the parent from parent.location....
Can I trouble you to re-post the script with your suggestion embedded in it?
Thanks so much!
Rob.CrazyHostGuy.com - Multiple domain hosting in one Plan
Hosting Plans starting at $1.95/month
Unlimited Domain Reseller Accounts available
www.crazyhostguy.com
-
Jul 15, 2002, 00:54 #6
- Join Date
- Feb 2002
- Location
- Gatwick, UK
- Posts
- 1,206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:try { document.cookie = "id=" + mySearch + "; expires=" + expireDate.toGMTString(); } catch (e){ alert(e.type); alert(e.code); alert(e.description); }
Flawless---=| If you're going to buy a pet - get a Shetland Giraffe |=---
Bookmarks