Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP_Referer Cookie Google Tracking

Status
Not open for further replies.

mcode12

Programmer
Aug 8, 2007
25
GB
Hello,

I am trying to track the keywords that people arrive at my page through Google.

I'm using the ServerVariable HTTP_Referer from which I can extract the keywords.

The reason I am doing this is to use PayPal's custom field to insert the keywords, so I'll know what someone has typed into Google and gone through a purchase.

My issue is I'll need to store the keywords in a cookie, just in case the visitor doesn't buy intially or goes to another site or page before coming back to buy.

So my question is twofold:

1. Will I need to check for the existence of the cookie each time the visitor comes to the site?
2. Will I need to check that the cookie has been updated (perhaps they have searched Google using new keywords)

Thanks.
MC.

 
thread333-1099654
thread333-991814


1. Will I need to check for the existence of the cookie each time the visitor comes to the site?
Yes How else are you going to know it's a returning visitor?

2. Will I need to check that the cookie has been updated (perhaps they have searched Google using new keywords)
You won't know if it's a return visitor unless you check the cookie and you won't know if they have used a different query unless you check the referer again.
Your cookie won't get updated by a visitor going to google and searching, only your server can update (or read) your cookie.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top