You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`session_id` > Google Analytics does not specify a required type of **session or user id**. You are free to use any kind of **unique identifier** you want; the catch, however, is that Google Analytics populates some internal data with `gtag.js`, that is then referenced to their `_ga` cookie session id. Just be aware that `gtag.js` is using *client-side Javascript* and can therefore have some **GDPR complications** as requests back to Google Analytics contains client information; such as their IP Address.
71
+
70
72
1. Acquire proper GDPR Consent
71
73
2. Client/GTAG.js sends session_start and first_visit to GA4
72
-
3. GA4 sends _ga and _gid cookies to Client/GTAG.js
73
-
4. Server uses _ga to populate events
74
+
3. GA4 sends _ga and _gid cookies back to Client/GTAG.js
75
+
4. Server uses _ga (or _gid; or your unique session_id) to populate events
76
+
77
+
Note: It is entirely possible to push events to backend without acquiring the session cookies from Google Analytics; you will however lose information bundled inside the `GTAG.js` request if you do not figure out how to push that via backend too.
This library is built for backend server side tracking, but you will probably trigger most events through frontend with Javascript or Websockets. There will be 2 examples, one as pure backend for logged/queued events and one for frontend to backend communication.
0 commit comments