简体   繁体   English

Rails:有没有办法告诉请求的来源?

[英]Rails: is there a way to tell the source of the request?

Google analytics tells me what the source of my traffic is (search engines, facebook etc). 谷歌分析告诉我我的流量来源是什么(搜索引擎,Facebook等)。 Is there a way to get this information for each request from the request object or otherwise? 有没有办法从request对象或其他方式获取每个请求的此信息? I'd appreciate any help. 我很感激任何帮助。

request.referrer将为您提供HTTP referrer值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有办法告诉Rails进程在运行时加载哪些gem和插件? - Is there any way to tell which gems and plugins are loaded at runtime for a Rails process? Ruby on Rails:有没有办法告诉ActiveRecord哪些字段验证失败? - Ruby on Rails: Is there a way to tell what fields failed validation in ActiveRecord? Rails源代码:以奇怪的方式初始化哈希? - Rails source code : initialize hash in a weird way? 进入任何Rails项目文件夹,是否有可靠的方法可以知道正在使用和创建哪个版本的Rails? - Going into any Rails project folder, is there a reliable way to tell which version of Rails it is using and created with? 这是在Rails 4中执行AJAX请求的好方法吗? - Is this a good way to do AJAX request in Rails 4? 从rails中的请求创建关系的“正确”方式? - "Correct" way to create relations from a request in rails? 在Rails中,是否可以在类(而不是控制器)中调用request.request_uri? - In Rails, is there a way to call request.request_uri in a class (not a controller)? 如何判断导轨是否在生产中? - How to tell if rails is in production? 在开发人员模式下,如何明确告诉Rails在每个请求上重新加载文件? - How to tell Rails explicitly to reload a file on each request while in dev mode? 有没有办法从Rails控制台查看方法的源代码? - Is there a way to view a method's source code from the Rails console?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM