How does Google Analytics work in real time?

I’m wondering how the Google Analytics user interface works in real time, what is the technique? Do they use a long client polling to instantly update user interface statistics by providing real-time information from the server to the client? I just open the Chrome dev tool on a network tab and on an endless request at https://www.google.com/analytics/realtime/bind Does anyone know a trick? It works flawlessly ...

+6
source share
2 answers

Below is how real-time data is collected, not how the user interface is updated. (it looks like the user interface just uses client-side AJAX polling)

There is no specific polling method or client side. Data collection is the same as always.

Instead, Google Analytics will assume that someone who triggered a pageview in the last 5 minutes is still an β€œactive” visitor.

From e-nor:

These visitors have been active for the past 5 minutes, any of them have been inactive for more than 5 minutes.

+6
source

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

+1
source

Source: https://habr.com/ru/post/902769/


All Articles