Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I find what search terms (if any) brought a user to my site?

I want to create dynamic content based on this. I know it's somewhere, as web analytics engines can get this data to determine how people got to your site (referrer, search terms used, etc.), but I don't know how to get at it myself.

like image 789
Thomas Owens Avatar asked Oct 30 '25 18:10

Thomas Owens


1 Answers

You can use the "referer" part of the request that the user sent to figure out what he searched for. Example from Google:

http://www.google.no/search?q=stack%20overflow

So you must search the string (in ASP(.NET) this can be found be looking in Request.Referer) for "q=" and then URLDecode the contents.

Also, you should take a look at this article that talks more about referrers and also other methods to track your visitors:

http://www.15seconds.com/issue/021119.htm

like image 52
Espo Avatar answered Nov 02 '25 20:11

Espo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!