GA4 weird session data
we switched from GTM to zaraz and for the most part everything is working fine, but our GA4 sessions seem to be pretty broken. for example one of our employees in martinque is browsing the site, but we are seeing 3 sessions instead of 1. does anybody know how to fix this?
10 Replies
@yo'av It seems like every pageview event starts a new session in GA4, without ending the previous session. So we are accumulating quite a few session.
We are using SPA navigation and it seems to be working as expected in the Zaraz debug window.
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Cloudflare domain or website?
But zaraz is running on cloudflare.croit.de
so this is a single visit to our homepage (as can seen by the single page_view) but there have been 3 session_starts/first_visits

this is kinda urgent because my marketing guy is demanding we switch off of zaraz (which I really want to avoid)
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
yeah no worries, we'll just switch back to GTM
Although this is quite late, just wanted to chime in and say that we saw the same issue.
What seems to happen is that Zaraz detects that the previous session has expired, and then start a new one. But saving that new session id doesn't work. This means that a new session is started on all captured events - including engagement measurements fired when the page/tab comes in and out of focus.
The cause seems to be that the collection endpoint does not return a cookie.
We have seen this behaviour when running zaraz on a subdomain via i.js instead of doing injection.