LW IT Solutions logo LW IT Solutions logo LW IT Solutions
« Blog Overview /Digital Analytics / Moving GA4 Visitor IDs to the Server:...
Read this article in other languages:

Moving GA4 Visitor IDs to the Server: The Tag Manager Migration Option

Part 2 of 5 in the series From pixel to server: tracking that holds

Moving GA4 Visitor IDs to the Server: The Tag Manager Migration OptionMoving GA4 Visitor IDs to the Server: The Tag Manager Migration Option

Management Summary

GA4 uses browser identifiers to recognise recorded visits across website interactions. Moving management of those identifiers from the browser to a server can interrupt that continuity and make reports harder to compare. The migration option helps carry an existing identifier into the new arrangement instead of immediately treating it as new. This is relevant when changing how website measurement operates. It cannot recover deleted identifiers, and browser restrictions and consent still limit recognition.

Contents
  1. Separate the two settings
  2. What migration is intended to preserve
  3. HttpOnly provides a specific protection
  4. Two years in Safari is not guaranteed
  5. A controlled transition test
  6. Questions and answers
  7. Sources

The GA4 client in server-side Google Tag Manager receives measurement requests and prepares events for server tags. Client identification determines the browser identifier in outgoing GA4 data. Changing that identifier can affect user counts, session association and longer-term analysis.

Separate the two settings

JavaScript Managed uses the client ID supplied by the browser. The usual _ga cookie contains that identifier alongside format components: GA1.1.123456789.1680000000 is a cookie value, while 123456789.1680000000 is the client ID within the value. A client ID is not a reliable identity for a person.

Server Managed uses a server-managed identifier, typically stored in the FPID cookie. An HTTP response sets this cookie, which remains stored in the browser. The additional Migrate from JavaScript Managed Client ID option concerns the transition from existing browser identifiers; the checkbox does not itself select the management mode.

Comparison of the JavaScript-managed _ga cookie and the server-managed FPID, with the mapping in server-side GTM
JavaScript Managed and Server Managed are identification modes. The additional migration option concerns the transition; the outgoing client ID requires verification.

What migration is intended to preserve

For an existing measurement setup, migration is intended to avoid an abrupt change of existing client IDs. This is neither a retrospective merger of all identifiers nor a guarantee of unchanged attribution, meaning the assignment of a conversion to a marketing source. Already deleted or expired identifiers cannot be recovered through this setting.

Describing migration as “converting the old cookie into FPID while keeping the GA4 identity identical forever” is insufficient. The forwarded client_id is what matters. Before changing production settings, comparison of incoming and outgoing identifiers in the deployed client version must establish how existing IDs, fresh profiles and existing FPID cookies are handled.

HttpOnly provides a specific protection

HttpOnly prevents direct access to the cookie from page JavaScript, for example through document.cookie. Cross-site scripting (XSS) means that injected malicious code runs in a website’s context. HttpOnly reduces simple cookie theft in some of these attacks. The website does not become immune to XSS: malicious code can still modify page content or initiate requests. An analytics identifier is also different from a login session cookie.

Two years in Safari is not guaranteed

A configured expiry date does not guarantee actual retention. WebKit can also restrict cookies set in HTTP responses: detected third-party CNAME or IP cloaking triggers a seven-day cap. Private sessions, cookie deletion and browser settings can further reduce availability. ITP is WebKit’s Intelligent Tracking Prevention, a set of browser measures that limit tracking. FPID does not bypass these measures in every situation.

Testing must cover the first-party endpoint, cookie domain, path, HTTPS and actual browser responses. Consent requirements still apply to storing and using the identifier.

A controlled transition test

  1. The current container version and settings are saved first. Initial tests use a separate measurement setup.
  2. A profile with an existing client ID and a fresh profile provide two test cases. The comparison covers incoming IDs, response cookies and outgoing GA4 client IDs.
  3. Separate tests cover subsequent page views, existing FPID cookies, expired or removed identifiers, rejection and withdrawal.
  4. The test covers every event route: browser events, server-side purchases, Measurement Protocol where applicable and multiple domains. Different IDs can split the same journey.
  5. After a controlled release, monitoring compares users, sessions and campaign assignment by browser with the actual rollout date.

An identifier change can weaken historical continuity. That does not mean every visit must become a new user or every conversion must become “Direct / None.” Other identity signals, campaign parameters and reporting settings affect the outcome.

Questions and answers

Is migration always required?

Keeping JavaScript-managed identification requires no FPID migration. An established measurement setup moving to Server Managed warrants specific transition testing. A new setup without existing identifiers has no such legacy population.

Does the identifier survive deletion of all cookies?

A deleted FPID cookie is no longer available to the server. Recognition through other permitted signals is a separate matter; FPID alone does not restore the deleted identifier.

Is the internal migration algorithm fully established here?

No. Public Google introductory documentation explains server cookies and processing but does not specify every internal transition case. Testing the deployed GA4 client version therefore remains part of the migration.

From pixel to server: tracking that holds

  1. The Evolution of Web Tracking: From Log Files to the Server-Side Future
  2. Moving GA4 Visitor IDs to the Server: The Tag Manager Migration Option
  3. Hosting Google Tag Manager on Cloud Run: Planning Capacity, Reliability and Costs
  4. Reporting Later CRM Sales to GA4: Using the Measurement Protocol
  5. Matching Meta Purchase Events Correctly: Preparing Customer Data and Avoiding Duplicates
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

A question or an idea for a web project? Tell me a little about it. This form uses reCAPTCHA and formconfirmed to protect against spam.

Write a comment

Differing figures from other accounts and questions about the setup are welcome here.

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

LUKASWOJCIK.COM · NEWSLETTER

Fresh ideas in your inbox

New articles, practical tools and updates from the projects.

Choose topics (optional)
No selection: all topics.

Subscription starts after confirmation by email. · Privacy

Privacy · Newsletter

Email address, language, selected topics and subscription/confirmation dates are stored to deliver the newsletter. Double opt-in is required. Every issue includes an immediate unsubscribe link. Formconfirmed checks the signup for spam. No email open or click tracking.

Read the full privacy policy ↗