Google Analytics是否有“心跳”功能?函数为长期运行的Web应用程序? [英] Does Google Analytics have a "heartbeat" function for long running web applications?

查看:88
本文介绍了Google Analytics是否有“心跳”功能?函数为长期运行的Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个专注于嵌入式内容的网络应用程序。我希望应用程序客户端向GA(Google Analytics)发送心跳类型的信号,以保持会话进行。现在看来,如果访问者观看5-10分钟的视频,GA会假定他已离开页面并将用户的操作注册为新会话。



在我有几百人测试应用程序和GA实时测试版在网页上注册了约100人之后,我做了这个假设。几分钟后,数字开始大幅下降,尽管几乎所有的访问者仍在使用该应用程序观看实时流。



谢谢 $ b $我会每隔10分钟用opt_noninteraction设置为true来激发一个事件。



pre $ 函数ga_heartbeat(){
_gaq.push(['_ trackEvent','心跳','心跳', '',0,true]);
setTimeout(ga_heartbeat,10 * 60 * 1000);
}
ga_heartbeat();

您甚至可以将超时时间设置得更长。也许25分钟。它只需要短于30分钟并超过10秒,否则会受到命中扼杀

更新



请注意,GA也可以限制500次点击会话/访问。使用这样的东西可能会导致您更频繁地达到此限制。在达到500次点击/会话限制后,用户发送的任何额外信息都会被Google Analytics忽略,针对该特定会话。


I'm making a web application that's focused around watching embedded content. I would like the application client to send a "heartbeat" type of signal to GA (Google Analytics) to keep the session going. It seems now that if the visitor watches a video for 5-10 minutes GA assumes that he has left the page and registers an action from the user as a new session.

I'm making this assumption after I got a few hundred people to test the application and the GA Real-time beta registered ~100 people on the page. After a few minutes the numbers started to drop drastically, even though almost all the visitors were still using the application to watch live streams.

Thanks

解决方案

I would fire an event every 10 minutes with opt_noninteraction set as true.

function ga_heartbeat(){
  _gaq.push(['_trackEvent', 'Heartbeat', 'Heartbeat', '', 0, true]);
  setTimeout(ga_heartbeat, 10*60*1000);
}
ga_heartbeat();

You could even set the timeout to be longer. Maybe 25 minutes. It just needs to be shorter than 30min and longer than 10 seconds, otherwise it would be impacted by hit throttling.

Update

Note that GA also has a restriction of 500 hits you can send per session/visit. Using something like this can lead you to reaching this limitation more often. After the 500 hits/session limit is reached any extra info sent by the user is just ignored by Google Analytics for that specific session.

这篇关于Google Analytics是否有“心跳”功能?函数为长期运行的Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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