Google分析通过ajax调用记录页面视图 [英] Google analytics record page view though ajax call

查看:138
本文介绍了Google分析通过ajax调用记录页面视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在加载内页内容时通过ajax操作记录页面视图。问题是跳出率数据没有更新(总是0%)

从页脚记录的默认ga页面查看记录。

 <脚本> 
(function(i,s,o,g,r,a,m){i ['GoogleAnalyticsObject'] = r; i [r] = i [r] || function(){
(i [r] .q = i [r] .q || [])。push(arguments)},i [r] .l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a,m)
})(window,document,'script' , '// www.google-analytics.com/analytics.js','ga');

ga('create','UA-xxxx-1','auto');
ga('send','pageview');

< / script>

在此之后,我执行代码加载内部页面内容,然后记录此操作的页面视图。 p>

 函数gapPageView(哈希)
{
ga('send','pageview',{'page' :hash});
}

页面视图条目已成功记录在Google分析中,并可在所有页面中看到。
/
/ step1

可能我访问过同一页面并关闭了选项卡。删除浏览器cookie并打开新的会话。
但step1的跳出率没有数据变化。

请帮我理解我是否在这里丢失了某些东西。

解决方案

正如我所看到的,您在同一页面中激发了两个单独的页面视图,以检查它是否正确加载。



跳出率是反弹的会话百分比。如果你正在寻找一个页面级别,如果你首先到达这里,那么你只能算作Session,如果你是从这里开始的,那么你只能算作Bounce,然后不再进行交互(这可能只会在30分钟后注册,因为它会挂在希望你可能再次交互)。

这意味着你只能在你看到的网站的第一页上算作Bounce,所以有人不可能在第二个页面视图中弹跳。



同时,如果没有进一步的交互,第一个页面视图将仅被视为反弹。由于您几乎立即启动了另一个页面视图,因此用户几乎不可能在第一个页面视图上弹跳。他们必须以某种方式避免第二个触发器,例如因为网站的这部分没有加载,或者他们可能在恰当的时间关闭了浏览器。除非您的网站拥有大量流量,否则这种情况不太可能发生。


I am logging page view through ajax action when my inner page content gets loaded. Issue is bounce rate data is not updated (always 0%)

Default ga page view record logged from footer.

<script>
 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxx-1', 'auto');
  ga('send', 'pageview');

</script>

After this I am executing code to load inner page content then logging page view for this action.

function gapPageView(hash)
{
   ga('send', 'pageview', { 'page': hash});
}

Page view entries are recorded successfully in google analytic and can seen in All pages report. / /step1

May time I visited same page and closed tab. removed browser cookies and open new session. But there is not data change in bounce rate of step1.

Please help me understand if I am missing something here.

解决方案

As I see it, you're firing two separate page views within the same page, to check that it's loaded properly.

Bounce Rate is the percentage of Sessions which Bounced. If you're looking at a page level, you only count as a Session if you arrived here first, and you only count as a Bounce if you began here, and then interacted no further (which will likely only register 30 minutes later, as it will hang on to the hope that you may interact again).

This means that you can only count as a Bounce on the first page of the site that you saw, so it's impossible for somebody to bounce on the second page view.

Meanwhile the first page view will only be treated as a Bounce if there is no further interaction. Since you fire another page view almost immediately, it's almost impossible for a user to bounce on the first page view. They'd have to have avoided the second trigger somehow, such as because that part of the site didn't load, or perhaps that they closed the browser at the exact right time. This is unlikely to happen unless you have a lot of traffic to your site.

这篇关于Google分析通过ajax调用记录页面视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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