GA4 client_id, ga_session_id and ga_session_timestamp data retrieval

Hello,

I am currently migrating our GA4 client side implementation to Zaraz.

I am trying to find out if there is a way to retrieve the client_id, ga_session_id and ga_session_timestamp in the client side from Zaraz.

As far as I can tell Zaraz creates a cookie in the following format.

{
   "jqZC_engagementDuration":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_engagementStart":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_counter":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_session_counter":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_ga4":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC__z_ga_audiences":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_let":{
      "v":"XXX",
      "e":XXX
   },
   "jqZC_ga4sid":{
      "v":"XXX",
      "e":XXX
   }
}

If the following post is correct, Google analytics cookie control with zara?, the above cookie data should do the trick.

As far as I understand the zaraz cookie is encrypted and not accessible in the client side. For us it is important to retrieve those data, as we implement session attribution with GA4 measurement protocol, the most accurate way to tie online to offline behavior, according to google docs.

Every time a user makes an action and we send some data to the server, we pass the client_id, ga_session_id and ga_session_timestamp, in order to tie the online event to the server side one.

Is it possible for us to retrieve those data from Zaraz cookie or in any alternative way?

Thanks in advance!

I managed to retrieve the using a service worker

Thanks!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.