开发者

Determining whether a user arrived from Google (and the query he used if so)

开发者 https://www.devze.com 2023-02-08 03:51 出处:网络
From within my Rails app, how do I determine whether a user arrived on a given page by clicking a Google (or Bing or Yahoo) search result?

From within my Rails app, how do I determine whether a user arrived on a given page by clicking a Google (or Bing or Yahoo) search result?

If the user arrived in this fashion, ho开发者_如何学Pythonw do I determine what search terms he used?


Have a look at

referer = @request.env["HTTP_REFERER"]

then, parse the info you're looking for (site, query) from that string.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号