1

I want to track google search keyword for site in asp classic. Any user which use any word in google search to reach on my site, I want to track this word.

2
  • So you want to do it in ASP or JavaScript?
    – alex
    Oct 28 '11 at 5:50
  • actually i want to track a user search a word(product name) in google, then he reached on my product site. i have to track that word and store it to db. yes in asp cllasic or javascript
    – Arun
    Oct 28 '11 at 6:08
1

You should be looking at the referer header in the HTTP request and see if your user was coming from the Google search engine. You could match it against a regular expression to match any google domain:

(www\.)?google\.[a-z]{2,4}

If it does, you can extract the query string parameters from the referer and look for the q parameter. It's value will be the search term the user used before it clicked on the link to your site.

You can get the referer header in ASP with:

Request.ServerVariables("HTTP_REFERER")

(and yes, it's "referer", famously spelled incorrectly)

0

You could use Google Analytics for this.

1
  • actually i want to track a user search a word(product name) in google, then he reached on my product site. i have to track that word and store it to db.
    – Arun
    Oct 28 '11 at 6:07
0

You can get the referring URL from the ASP Server object and parse out the search term from the string.

The problem with doing this is that Google is going to remove referrer information from some searches. See this link for more info on the change: http://www.seroundtable.com/google-ssl-drops-query-data-14188.html

1
  • thx for good help
    – Arun
    Nov 4 '11 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.