使用主题标签在一页网站上跟踪 Google Analytics
我有一个很长的单页网站,当您通过滚动或单击到达某个部分时,在 URL 中使用主题标签。我可以使用什么技术来跟踪这些主题标签作为谷歌分析中的“页面”?
I have a long single page website using hashtags in the URL when you get to a certain section from scrolling or clicking. What technique can I use to track these hashtags as "pages" in google analytics?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
(从之前的回收回答...)
一般来说,您的代码可能如下所示:
您可以在应用程序中每次发生哈希更改时绑定该代码,也可以使用 通用 hashchange 插件,使用 HTML5 onhashchange 以及一些针对旧版浏览器的向后兼容的 hack,并将此代码绑定到该事件,因此每次你的哈希值改变时它都会触发。
使用该插件,您的代码可能如下所示:
(Recycling from a prior answer...)
Generically, your code could look like this:
You could either bind that code to every time you have a hash change within your application, or you could use a generic hashchange plugin, that uses the HTML5 onhashchange, and some backwards compatible hacks for older browsers, and bind this code to that event, so that it fires every time your hash changes.
Using that plugin, your code could look like:
是的,虚拟综合浏览量就是您的解决方案,教程如下:http://services .google.com/analytics/breeze/en/et_vps/index.html
Yeah, virtual pageviews is your solution, here's the tutorial: http://services.google.com/analytics/breeze/en/et_vps/index.html
我相信您可以在您的谷歌分析中使用类似的谷歌分析
,然后它会在您指定的文件夹结构中记录一次点击
I believe you can use google analytics something like this
in your google analytics it will then record a click in the folder structure you specify