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...
我想知道Google Analytics Real Time用户界面是如何工作的,技术是什么?他们是否使用来自客户端的长轮询来通过从服务器向客户端提供实时信息来使UI统计信息保持最新?我只是在网络标签上打开Chrome开发工具,https://www.google.com/analytics/realtime/bind上有无限请求有人知道这个技巧吗?它完美无瑕......
2 个解决方案
#1
6
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)
以下是指如何收集实时数据,而不是如何更新UI。 (看起来UI只是在客户端使用AJAX轮询,但是)
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.
相反,Google Analytics会假设在过去5分钟内触发了综合浏览量的人仍然是“活跃”访问者。
These visitors have been active in the last 5 minutes, any one not active for over 5 minutes is dropped.
这些访问者在最近5分钟内一直处于活动状态,任何一个未活动超过5分钟的访问者都将被删除。
#2
1
I was one of two people who built the first version of the Realtime Analytics UI. We used Closure's BrowserChannel.
我是构建Realtime Analytics UI第一版的两个人之一。我们使用了Closure的BrowserChannel。
#1
6
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)
以下是指如何收集实时数据,而不是如何更新UI。 (看起来UI只是在客户端使用AJAX轮询,但是)
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.
相反,Google Analytics会假设在过去5分钟内触发了综合浏览量的人仍然是“活跃”访问者。
These visitors have been active in the last 5 minutes, any one not active for over 5 minutes is dropped.
这些访问者在最近5分钟内一直处于活动状态,任何一个未活动超过5分钟的访问者都将被删除。
#2
1
I was one of two people who built the first version of the Realtime Analytics UI. We used Closure's BrowserChannel.
我是构建Realtime Analytics UI第一版的两个人之一。我们使用了Closure的BrowserChannel。