Forum Moderators: DixonJones
<<This is where a basic URL strip code snippet is usually insterted>>
Response.Cookies("mysite")("refhost") = GetHost(Request.ServerVariables("HTTP_REFERER"))
Response.Cookies("mysite")("source") = Request.QueryString("source")
Response.Cookies("mysite")("query") = Request.QueryString("q")
Response.Cookies("mysite").Expires = Date + 3
End If
END CODE ------------------------>
Then I extract the variables from the cookie and write that to the database when they convert.
Sometimes I get this...
Host: search.msn.com
Campaign: overture
Keyphrase: my special phrase
and, sometimes I get this...
Host: mydomainname.com <---- "This is my site domain"
Campaign:
Keyphrase:
and, sometimes I get this...
Host:
Campaign:
Keyphrase:
Any idea what is going on here? I have watched a few customers convert through a PPC, but wasn't able to grab the variables. They have to have cookies enabled to even buy anything, so I think the cookie is being written.
My tracking scripts are written in a combo of javascript & Perl, javascript calls the server & then the perl script logs the stuff, etc.
Sounds like you have a good thing started there though, knowing how a purchase was made online is crucial to the next level of success in any market.
Also are you always writing to the db even if there is not a cookie? Might want to try..
If Request.Cookies("mysite")("refhost") <> "" Then
write to the DB
End If
You may also want to have a few lines that detects if they can accept cookies. There is a good article at asp101. search for "cookie detection". The author makes note of a trailing? problem. Never heard of that one before.
You may need to set the domain if you running on a server farm as well.
Just some thoughts.