如何从引荐来源网址获取location.hashtag - Google Analytics [英] How do you get location.hashtag from the referrer url - Google Analytics

查看:103
本文介绍了如何从引荐来源网址获取location.hashtag - Google Analytics的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个网站使用页面按钮和标签(#)在他们的网址来操纵他们的内容(链接)的排序方式。他们链接到我的网站,我想知道人们在最终找到我的网站并点击之前点击了哪些按钮。



例如,引荐网址如下所示 - http://www.example.com/page1?content=1234#button1



有没有办法在哈希标签(#),所以我可以告诉人们如何排序找到我的网站?我想过使用 document.referrer.location.hashtag ,但我认为这种方法不行......



我最终希望将这些数据导入Google Analytics(我可以使用自定义变量来做这件事),但是有关如何在Google Analytics中执行此操作的任何其他提示都会受到赞赏。



感谢任何帮助与此!

解决方案

URL的散列部分永远不会发送到服务器,并且它看起来并不存储在JavaScript中对象为document.referrer。



访问URL哈希部分的唯一方法是在浏览器位于该页面时从页面内访问它。 / p>

翻译:除非您控制引荐页面,并且您在链接中传递散列片段,否则无法获取它。



更多信息: http://www.razzed.com/2009/02/12/u h-oh-ajax-powered-search-kills-keywords-in-referrers /


There's a site that uses on page buttons and hashtags (#) in their urls to manipulate how their content (links) is ordered. They link to my site and I'd like to know what buttons people are clicking before they finally find my site and click through.

For example, the referrer url looks like this - http://www.example.com/page1?content=1234#button1

Is there a way to extract the value after the hashtag (#) so I can tell how people are sorting to find my site? I thought about using document.referrer.location.hashtag but I don't think that works...

I'd ultimately like to import this data into Google Analytics (I can probably do that with a custom variable) but any other tips on how to do that in GA are appreciated.

I appreciate any help with this!

解决方案

The hash portion of URLs is never sent to the server, and it appears it is not stored in the javascript object for the document.referrer.

The only way to access the hash portion of a URL is to access it from within the page when the browser is on that page.

Translation: There's no way to get it unless you control the referring page, and you pass along the hash fragment in the link.

more info: http://www.razzed.com/2009/02/12/uh-oh-ajax-powered-search-kills-keywords-in-referrers/

这篇关于如何从引荐来源网址获取location.hashtag - Google Analytics的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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