Google Analytics中未收到片段 [英] Not receiving Fragment in Google Analytics

查看:114
本文介绍了Google Analytics中未收到片段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的网站:
https://example.com / path1 / path2 /#!portal / 1



我插入了ga脚本,并且在代码中进行了下一次修改($#
$ b $ p $ ga $'$'$'$' :location.pathname + location.search + location.hash
});

但当我检查ga页面时,在行为/行为流程/网站内容/所有页面我只有:
https://example.com/path1/path2/ p>

我是新手,我是否做错了什么?

解决方案

你在你的问题中的代码将工作得很好。我认为可能存在影响哈希URL的临时故障,但现在一切似乎都在进行中,所以我只是再试一次。



另外,就像您在构建AJAX网站一样,我建议您查看关于使用Google Analytics跟踪单页应用程序的开发者指南:

https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications


I have a website like this: https://example.com/path1/path2/#!portal/1

I've inserted the script of ga and I've made the next modification in the code to receive the fragment (after hash #):

ga('send', 'pageview', {
        'page': location.pathname + location.search  + location.hash
      });

But when I check the ga page, in "Behavior/Behavior Flow/Site Content/All Pages" I only have: https://example.com/path1/path2/

I'm new in ga, am I doing something wrong?

解决方案

The code you have in your question will work just fine. I think there may have been a temporary glitch affecting hash URLs, but everything seems to be working now, so I'd just try it again.

Also, since it sounds like you're building an AJAX site, I'd recommend taking a look at the developer guide on tracking single page applications with Google Analytics:
https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

这篇关于Google Analytics中未收到片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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