Rails:有没有办法告诉请求的来源? [英] Rails: is there a way to tell the source of the request?

查看:67
本文介绍了Rails:有没有办法告诉请求的来源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Analytics(分析)告诉我流量的来源(搜索引擎,facebook等).是否有一种方法可以从request对象获取每个请求的此信息?我将不胜感激.

Google analytics tells me what the source of my traffic is (search engines, facebook etc). Is there a way to get this information for each request from the request object or otherwise? I'd appreciate any help.

推荐答案

request.referrer将为您提供 HTTP引荐来源网址值.

这篇关于Rails:有没有办法告诉请求的来源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆