LW IT Solutions
« Blog Overview /Digital Analytics / GA4 & Server-Side GTM: The “Migrate from...
This post in other languages:

GA4 & Server-Side GTM: The “Migrate from JavaScript Managed Client ID” Feature Explained

Part 3 of 6 in the series From pixel to server: tracking that holds

GA4 & Server-Side GTM: The "Migrate from JavaScript Managed Client ID" Feature Explained
Contents
  1. The Cookie Battle: _ga vs. FPID
  2. What does “Migrate from JavaScript Managed Client ID” actually do?
  3. The “Reset” Apocalypse: What happens without migration
  4. When to select this option, and when not to?
  5. Sources

Moving Google Analytics 4 (GA4) tracking to Server-Side Google Tag Manager (ssGTM) unlocks a new level of data control, privacy, and cookie durability. One of the most powerful—yet misunderstood—features in the GA4 Client configuration is the “Migrate from JavaScript Managed Client ID” setting.

To understand why this checkbox is critical, we first need to understand how GA4 identifies users and the fundamental shift from Client-Side to Server-Side cookies.

Comparison of the JavaScript-managed _ga cookie and the server-managed FPID, with the mapping in server-side GTM
The setting decides who issues the identifier: JavaScript or the server container. That is the whole benefit — and the whole risk, because switching without preparation resets every existing ID.

The Cookie Battle: _ga vs. FPID

Historically, standard web analytics relied on JavaScript. When a user visits the site, the GA4 script drops a cookie named _ga. This cookie contains the Client ID (e.g., GA1.1.123456789.1680000000), which identifies the browser. Because this cookie is created by JavaScript in the browser, it is highly vulnerable to Intelligent Tracking Prevention (ITP) in Safari, which artificially limits its lifespan (sometimes to just 7 days or 24 hours). Firefox restricts such cookies through Enhanced Tracking Protection (ETP) and Total Cookie Protection.

Server-Side GTM offers a solution: Server Managed Client IDs. Instead of the browser generating the _ga cookie, the ssGTM server generates a secure, HTTP-only cookie named FPID (First Party Identifier).

  • Security: HTTP-only cookies cannot be accessed by client-side JavaScript, making them immune to cross-site scripting (XSS) attacks.
  • Durability: Because they are set directly by the server’s HTTP response, browsers like Safari treat them as true first-party data, bypassing ITP restrictions and preserving the user’s identity for much longer (up to 2 years).

What does “Migrate from JavaScript Managed Client ID” actually do?

Switching from the standard _ga cookie to the HTTP-only FPID cookie in the GA4 Client settings raises a transition problem.

With the setting “Migrate from JavaScript Managed Client ID” enabled, the ssGTM server performs a smart handshake. When a returning user visits the site, the server checks whether they already have an old _ga cookie. If they do, the server reads the existing Client ID from the _ga cookie, translates it into the new FPID format, and sets the new HTTP-only FPID cookie.

From that moment on, GA4 recognizes the user through the FPID, but the underlying identity remains the same as it was under the _ga cookie.

The “Reset” Apocalypse: What happens without migration

Switching to the FPID (Server Managed) cookie without enabling the migration option triggers an analytics catastrophe.

Without migration, the server ignores all existing _ga cookies. When a loyal, returning customer visits the site, the server says: “No FPID cookie here. The _ga cookie is irrelevant. A brand new FPID it is.”

The consequences in the GA4 reports:

  1. Massive Spike in New Users: Every single returning user will be classified as a “New User.”
  2. Broken Attribution: If a user clicked a Google Ads campaign yesterday (tracked via _ga) and buys today (tracked via the newly forced FPID), GA4 cannot connect the two sessions. The conversion will be attributed to “Direct,” and the ad campaigns lose their ROI credit.
  3. Fragmented User Journeys: The historical data for returning users is completely severed from their future actions.

When to select this option, and when not to?

When to ENABLE it:

  • Almost always. Whenever a live website moves an existing GA4 setup to Server-Side GTM using the FPID cookie, migration is mandatory to preserve user continuity, attribution, and audience targeting.

When to DISABLE it:

  • Brand new websites: On a site launched from scratch with zero historical traffic, there are no _ga cookies to migrate.
  • Strict Compliance Mandates: In extremely rare edge cases, a company’s legal department might dictate that moving to a new tracking infrastructure requires “forgetting” old identifiers to enforce a hard reset on user profiling.
  • Without FPID: Where the GA4 Client in ssGTM keeps using the JavaScript Managed Client ID (_ga cookie passed through the server) and the server-managed FPID feature stays off, this setting is irrelevant.

From pixel to server: tracking that holds

  1. The Evolution of Web Tracking: From Log Files to the Server-Side Future
  2. How to Implement Google Tag Gateway
  3. GA4 & Server-Side GTM: The “Migrate from JavaScript Managed Client ID” Feature Explained
  4. Server-Side GTM on GCP Cloud Run: Architecture, Auto-Scaling, and Cost Optimization
  5. GA4 Measurement Protocol: Server-Side CRM Offline Conversion Integration
  6. Meta Conversions API: Maximizing Event Match Quality (EMQ) and Deduplication
Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

2 comments

  1. Elliot Nakamura

    The reset scenario is described exactly as we experienced it at a previous employer — a wall of new users and attribution that fell into Direct overnight.

    What I have never seen addressed: the migration reads the existing _ga cookie. On Safari that cookie is capped at seven days, so for a visitor returning after three weeks there is nothing left to read. Does the migration setting actually preserve continuity for the browsers that motivated the move to FPID in the first place?

    1. Lukas Wojcik Author

      Not for that group, no. The migration salvages what still exists, and on Safari it frequently does not.

      The two mechanisms help opposite populations. Migration is worth most where the old identifier survived — Chrome and Firefox, returning visitors, long gaps. The server-managed cookie is worth most where the old one did not, which is precisely Safari. So the combination is not redundant, but it is also not symmetric: the visitors whose history is preserved and the visitors whose future is protected are largely different people.

      The practical consequence is about expectations rather than configuration. Enabling migration remains right — it costs nothing and rescues every identifier that is still there. What it will not do is prevent a step in new users at the cutover, because the ITP-affected share was already generating new identifiers every week; the switch merely makes that visible in one place. Splitting the new-user ratio by browser across the cutover separates the unavoidable part from a genuine misconfiguration, and takes about ten minutes.

Write a comment

The email address is not published. Required fields are marked with an asterisk.

ALL ARTICLES & CATEGORIES

CCTV

Follow this category by RSS

Cloud & AI

Follow this category by RSS

Data Privacy

All 11 articles in this category Follow this category by RSS

Digital Analytics

All 44 articles in this category Follow this category by RSS

Digital Marketing

All 25 articles in this category Follow this category by RSS

IT & Networks

All 15 articles in this category Follow this category by RSS

Raspberry PI

Follow this category by RSS

Smart Home

All 13 articles in this category Follow this category by RSS

Web Development

Follow this category by RSS

WordPress Plugins & Tricks

Follow this category by RSS