在javascript中获取推荐网址 [英] Get the referral url in javascript
本文介绍了在javascript中获取推荐网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道从各种网址缩短服务获得多少流量,例如
I want to see how much traffic I get from various URL shortening services like
bit.ly
tinyurl.com
tinyurl.com
但是因为他们使用301重定向,所以他们不会出现在我的分析中。
But because they use 301 redirection, they don't show up in my analytics.
如何找出重定向流量的人?
How can I find out who is redirecting the traffic?
或
更准确地说,我如何在javascript中获取推荐网址以进行不同类型的重定向?
More precisely how could i get the referral url in javascript for different kind of redirection ?
推荐答案
document.referrer
示例:
if (document.referrer && document.referrer != "")
document.write('Thanks for visiting this site from ' + document.referrer);
这篇关于在javascript中获取推荐网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文