Retrieving the Original _ga Cookie after Integrating GA4 with ZARAZ?

When I added Google Analytics 4 (GA4) to my website, it generated a cookie named _ga to record the client_id. However, when I loaded GA4 with ZARAZ, I noticed that the _ga cookie disappeared, but two global objects were added, namely zaraz and zarazData . How can I retrieve the original _ga cookie set by GA4?

Zaraz doesn’t use, read or write the original _ga cookie. Zaraz uses it’s own set of cookies. If you want to read the client ID from Google Analytics I recommend checking {{ system.clientKV.YOUR_TOOL_ID_ga }}

Thank you for your response. I have reviewed the documentation but I’m still a bit confused. Could you provide a simple example of how to retrieve the original _ga cookie in a browser using JavaScript?

Zaraz doesn’t read, use, or write the original _ga cookie. It has nothing to do with Zaraz.

If you want the value of client ID used by Google Analytics 4 in Zaraz, you can use system.clientKV. How to use it depends on where you want to use this value.

I’d like to retrieve this value using JavaScript when a user visits the browser. Could you advise me on how to do this?

use Custom HTML and do something like:

const value = "{{ system.clientKV.yourToolId_ga4 }}"