How does Google Analytics Real Time work?

六眼飞鱼酱① 提交于 2019-12-21 04:51:53

问题


I'm wondering how Google Analytics Real Time user interface works, what's the technique ? Do they use long-polling from the client to keep the UI statistics instantly up to date by delivering realtime information from the server to the client? I just open Chrome dev tool on network tab and there is a infinite request on https://www.google.com/analytics/realtime/bind Does anybody know the trick? It works flawless...


回答1:


The below refers to how the real time data is collected, not how the UI updates. (It looks like the UI is just using AJAX polling on the client-side, though)

No special polling or client-side technique is used. Data collection is the same as it always has been.

Instead, Google Analytics will assume that someone who's triggered a pageview in the last 5 minutes is still an "active" visitor.

From e-nor:

These visitors have been active in the last 5 minutes, any one not active for over 5 minutes is dropped.




回答2:


I was one of two people who built the first version of the Realtime Analytics UI. We used Closure's BrowserChannel.



来源:https://stackoverflow.com/questions/8330780/how-does-google-analytics-real-time-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!