Question Using Google Analytics GET Command

superaff1984

Senior Member
Premium Member
Joined
Jun 16, 2010
Messages
991
Reaction score
130
Hi, I have the following code below. How do I store the client ID and session ID into a cookie (in the browser) using PHP or Javascript?

gtag('get', 'G-654654654', 'client_id', (client_id) => {
// Store the client ID in a variable.
});
gtag('get', 'G-654654654', 'session_id', (session_id) => {
// Store the session ID in a variable.
});

Here is more information about this at https://developers.google.com/tag-platform/gtagjs/reference#get
 
Last edited:
Back
Top