GOOGLE TAG MANAGER UPDATE
The Analytics Storage Variable:
The Missing Link for Multi-Platform Tracking
The Problem Nobody Talks About
Every modern analytics team faces the same invisible wall: data lives in silos.
Google Analytics knows your users by Client ID. Your CRM knows them by email. Your ad platforms know them by click IDs. Your server-side infrastructure knows them by session tokens. They are all looking at the same human being — and calling them something completely different.
For years, connecting these systems inside Google Tag Manager meant one thing: custom JavaScript. You would write code to crack open the GA cookie, parse it, extract the Client ID, and hope it still worked after the next GA update. It was fragile, unofficial, and silently breakable.
On December 11, 2025, Google formally closed this gap. GTM now has an officially supported, native way to read Google Analytics identifiers — and the most powerful piece of this update is the new Analytics Storage user-defined variable.
| What was released on December 11, 2025 Three new built-in variables under Utilities: Analytics Client ID, Analytics Session ID, Analytics Session Number. One new user-defined variable type: Analytics Storage — with support for Measurement ID targeting and custom cookie prefixes. |
|---|
First: Why Cookies Matter Here
Before getting into the variable itself, it helps to understand what a cookie actually is in this context.
When someone visits your website for the first time, Google Analytics quietly writes a small sticky note into their browser. That sticky note — the cookie — contains a unique ID called the Client ID. It looks something like: 1234567890.1702300000
Every time that person returns, their browser shows GA this sticky note, and GA says: I remember you. This is how GA tracks returning users, sessions, and journeys over time. Without cookies, every single pageview would look like a brand new anonymous stranger. There would be no way to connect the dots.
GA4 writes three key values into this cookie structure:
- Client ID — who the user/device is (pseudonymous, persistent)
- Session ID — which browsing session is currently active
- Session Number — how many times this user has visited
The Analytics Storage variable is GTM's official mechanism for reading these values directly out of the cookie — without custom code, without brittle workarounds.
Built-In Variables vs. Analytics Storage Variable
GTM's December 2025 update introduced two different mechanisms. It is important to understand when to use each.
| Built-In Variables | Analytics Storage Variable | |
|---|---|---|
| Type | Built-In (enable a checkbox) | User-Defined (create manually) |
| Setup | One click in GTM | Create & configure a variable |
| Reads from | All GA cookies on page | Specific property's cookie |
| Measurement ID targeting | No | Yes |
| Custom cookie prefix | No | Yes |
| Best for | Standard single-property setups | Multi-property / advanced setups |
| Who needs it | Most teams (95%) | Complex / enterprise implementations |
The rule of thumb is simple: if you have one GA4 property and use the default cookie configuration, the built-in variables will cover everything you need. Reach for the Analytics Storage variable when your setup has complexity the built-ins cannot handle.
How to Create an Analytics Storage Variable
Step 1 — Open User-Defined Variables
In GTM, navigate to Variables in the left panel. Under the User-Defined Variables section, click New.
Step 2 — Choose the Variable Type
Click Variable Configuration, then search for Analytics Storage and select it.
Step 3 — Configure Three Fields
| Field | What It Does |
|---|---|
| Data Field | Choose what to return: Client ID, Session ID, or Session Number |
| Measurement ID (optional) | Target a specific GA4 property. Leave blank to read from all GA cookies |
| Cookie Prefix (optional) | If your Google tag uses a non-default cookie prefix, specify it here |
Step 4 — Name and Save
Use a clear naming convention so your container stays organised. A good pattern is:
| AS – Client ID (G-AAA111) AS – Session ID (Brand Prefix) AS – Session Number (Default) |
Working Example 1: Multi-Property Site
The Scenario
Your website sends data to two separate GA4 properties:
- G-AAA111 — owned by the Marketing team, used for campaign attribution
- G-BBB222 — owned by the Product team, used for feature analytics
Both properties write their own Session ID cookie for each visitor. The values can be different because they are managed by separate GA4 instances. If you ask GTM for 'the Session ID' without specifying which property, you may get the wrong one — or an unpredictable one from whichever cookie happened to load first.
You need to pass the correct Session ID to your CRM from each property separately, so your sales team can see the marketing journey and your product team can see the product journey — all tied back to the same human.
Create Variable 1 — Marketing Property
| Variable Name: AS – Session ID – Marketing Data Field: Session ID Measurement ID: G-AAA111 Cookie Prefix: (leave blank) |
Create Variable 2 — Product Property
| Variable Name: AS – Session ID – Product Data Field: Session ID Measurement ID: G-BBB222 Cookie Prefix: (leave blank) |
Use in a GA4 Event Tag
In your GA4 event tag, add these as custom event parameters:
| Parameter Name Value ───────────────────────────────────────────────── crm_session_id_mkt {{AS – Session ID – Marketing}} crm_session_id_product {{AS – Session ID – Product}} |
Now both teams receive the correct identifier from the correct property — no mix-ups, no guesswork, and no fragile cookie parsing code sitting in your container.
Working Example 2: Custom Cookie Prefix
The Scenario
Your team configured the Google tag with a custom cookie prefix for brand consistency or to avoid conflicts with other tools. The configuration looks like this:
| gtag('config', 'G-XXXXXXXX', { cookie_prefix: 'brand' }); |
GA4 now writes cookies named brand_ga and brand_ga_session instead of the default _ga and _ga_session. If you use the standard built-in variables or create an Analytics Storage variable without specifying the prefix, GTM looks for _ga — finds nothing — and returns undefined.
Create the Variable
| Variable Name: AS – Session ID (brand prefix) Data Field: Session ID Measurement ID: (leave blank) Cookie Prefix: brand |
GTM now reads from the brand_ga_session cookie correctly. The Session ID is available reliably, and you can pass it downstream to any system that needs it.
Why This Matters for Multi-Platform Tracking
The Client ID is your common thread across every platform in your stack. Here is how a single user journey touches multiple systems — and how the Client ID holds it together:
| Platform / System | How Client ID Connects It |
|---|---|
| Google Analytics 4 | Primary source — writes and owns the Client ID in the browser cookie |
| Google Ads | Offline conversion imports use Client ID to match website sessions to ad clicks |
| CRM (Salesforce, HubSpot) | Store Client ID against contact records to link web behaviour to real people |
| Measurement Protocol | Server-side hits require Client ID to be attributed to the correct GA4 user |
| Meta / Other Ad Platforms | Pass Client ID as a custom parameter for cross-platform attribution modelling |
| Data Warehouse (BigQuery) | Join GA4 export data with CRM data using Client ID as the shared key |
Before this GTM update, accessing the Client ID reliably enough to power all of the above required custom JavaScript that could break silently. Now it is a native, officially supported variable — which means it is stable, future-proof, and safe to build your entire measurement stack on top of.
How Is This Different From a Lookup Table?
A common question when teams first encounter the Analytics Storage variable is: why not just use a Lookup Table with the Measurement ID?
The answer is that these two variable types do fundamentally different things.
| Variable Type | What It Actually Does |
|---|---|
| Lookup Table | Takes an input, returns a mapped output. It stores and returns strings. It has no ability to read cookies, access the browser, or retrieve live data. |
| Analytics Storage | Actively reads from GA4 cookies in the browser right now. Returns a live value — the actual Client ID or Session ID the user has in this moment. |
A Lookup Table can tell you that G-AAA111 belongs to the Marketing team. It cannot go and fetch the Client ID for G-AAA111. The Analytics Storage variable is the one that actually opens the cookie and reads the value.
| A legitimate combined pattern Use a Lookup Table to determine which Measurement ID applies based on some condition (e.g. the current domain or page path). Feed that result into the Measurement ID field of an Analytics Storage variable. This way you can dynamically switch which property's Client ID to retrieve — without hardcoding it. |
|---|
Summary
The Analytics Storage variable is not a flashy feature. It is a foundational one.
It gives analytics practitioners a reliable, officially supported, native mechanism to retrieve the values that sit at the heart of modern measurement: Client ID, Session ID, and Session Number — from any specific GA4 property, with any cookie configuration.
For teams running standard single-property setups, the new built-in variables will be sufficient. For teams running multi-property implementations, custom cookie prefixes, server-side tracking, CRM stitching, or offline conversion pipelines — the Analytics Storage user-defined variable is now the correct, stable, future-proof tool to use.
The unofficial cookie-parsing workaround era is over. There is now a proper path.
| Action items Audit your GTM container for any custom JavaScript variables reading _ga cookies manually. Replace them with either the built-in Analytics Client ID variable (simple setups) or the Analytics Storage user-defined variable (multi-property / custom prefix setups). Update your CRM webhook tags, Measurement Protocol tags, and any offline conversion imports to use the new native variables. Test in GTM Preview to confirm the variables return expected values before publishing. |
|---|
Published December 2025 | #GoogleTagManager #GA4 #DigitalAnalytics #MarTech
