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

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

问题描述

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

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.

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

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

有没有办法提取主题标签 (#) 后的值,以便我知道人们如何排序以找到我的网站?我想过使用 document.referrer.location.hashtag 但我认为这行不通...

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...

我最终想将这些数据导入 Google Analytics(我可能可以使用自定义变量来做到这一点),但感谢任何其他关于如何在 GA 中做到这一点的提示.

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!

推荐答案

URL 的哈希部分永远不会发送到服务器,而且它似乎没有存储在 document.referrer 的 javascript 对象中.

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.

访问 URL 哈希部分的唯一方法是当浏览器在该页面上时从该页面内访问它.

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.

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

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

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