Forum Moderators: DixonJones
BEGIN CODE ---------------------->
If Request.Cookies("mysite")("refhost") = "" Then
<<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.
Many PPC ROI trackers use custom URLs to nail precisely where the traffic came from. Of course, if you are trying to integrate your analysis with other traffic (e.g., links, non-PPC searches, etc.) you will need to analyze the HTTP_REFERER also.
Thanks for getting to my issue. I was thinking that could be the problem. Oh well. In the future, I'll code a more advanced system where I can just pull the info from my logs (i.e.- I'll have each click go to an orphaned specific page setup just for the purpose of tracking. I just hate looking at logs!
Thanks much.
IIS 4 has a bug, won't always grab the querystring if your source code comes in on a directory path instead of a page name.
in other words;
[mydomain.com...]
will fail, while
[mydomain.com...]
will work.
From one of your examples, it looks like this may be the case for you.