Google Tag Manager has added three new built-in variables in the Utilities category: Client ID, Session ID, and Session Number.
These variables provide an official and supported way to access key Google Analytics values directly within GTM, making it easier for advertisers and analysts to implement tracking without custom JavaScript.
In addition, GTM introduces a new Analytics Storage user-defined variable type. This allows users to retrieve analytics values using a specific measurement ID and/or a custom cookie prefix, offering more flexibility for advanced tracking setups and complex configurations.
Why it matters
- Access to Client ID, Session ID, and Session Number is now simplified and officially supported
- Reduces the need for manual coding or custom scripts to extract analytics values
- The new Analytics Storage variable enables precise, flexible retrieval of GA4 data for complex or multi-property setups
Practical Tips
- Use the built-in variables to track unique users, sessions, and session counts in GTM triggers or tags.
- Implement the Analytics Storage variable when working with multiple GA4 properties or custom cookie setups.
- Test tracking thoroughly in preview mode to ensure variables return the correct values.
- Document variable usage for team members to maintain clarity across campaigns and setups.
These updates make GTM more powerful and flexible for both standard and advanced analytics configurations, while keeping implementations officially supported and easier to maintain.
