GA4 Cross-Device Tracking: From Ghost Users to Real Customers with User-ID
GA4 Cross-Device Tracking: From Ghost Users to Real Customers with User-ID

In the modern digital world, the user journey is not linear. A user might browse your products on their phone during the morning commute, run a detailed comparison on their office desktop at lunchtime and complete the purchase on their tablet at home in the evening. In the physical world, there is only one person. On the analytics side, however, this scenario often looks like three separate users.
With the default setup, Google Analytics 4 recognizes users via Client-ID, a device-based identifier. When the device changes, the browser changes or cookies are cleared, the system sees the same person as a new user.
The result:
- User counts higher than they really are
- Artificially lower conversion rates
- Fragmented funnel analyzes
- Incorrect evaluation of marketing performance
The data in your analytics panel grows, but the real person inside it gets lost. We can call this the “ghost user” problem.
How Does User-ID Solve This Problem?
User-ID references the person, not the device. The critical point, however, is that the User-ID is not generated by Google; it is passed from your own system.
A unique ID already exists in your database for every logged-in user.
This ID:
- Must be anonymous
- Must not mean anything when viewed from the outside
- Must not contain personal data (PII) such as email, phone number or name
Usually, the internal user ID that already exists in the system is sent directly or hashed with SHA-256.
Step-by-Step Technical Workflow:
1) Backend (The Source of Identity)
When the user logs in, the unique ID belonging to that user is retrieved on the backend. This ID is not generated; it already exists in the system.
2) Data Layer (Passing the Identity)
After login, this value is sent to the dataLayer:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
user_id: "88219"
});The critical point here is that the User-ID is managed correctly according to the user's status.
Sending User-ID Based on User Status (Critical Rule)
The implementation logic Google recommends is as follows:
- If the user has never logged in → the user_id parameter should not be sent.
- If the user is logged in → the user ID should be sent.
- If the user has logged out → user_id: null should be sent.
Why is this important?
If the same user_id value keeps being sent after the user logs out, someone else using the same device might be mistakenly matched with the previous user. This leads to serious data corruption.
Sending null at the moment of logout gives GA4 a clear signal:
“This device no longer belongs to that user.”
This small detail is vital for data integrity.
3) Google Tag Manager Layer
Google Tag Manager reads the user_id variable in the dataLayer and passes it to the User-ID field in the GA4 Configuration tag.
Things to watch out for:
- The GA4 configuration tag must fire on all pages.
- User-ID should be defined at configuration level, not per event.
4) GA4 Reporting Identity Setting
In the Google Analytics 4 Admin panel, the Reporting Identity setting should be set to “Blended”.
In Blended mode, the order of priority is:
- User-ID
- Device ID (Client-ID)
In other words, if a User-ID is available, GA4 moves the device ID to second place and stitches devices together using the identifier you send.
The Limits of User-ID
User-ID only works for logged-in users. It does not stitch together anonymous visitors.
For this reason:
- Its impact may be limited on sites with low login rates.
- Its impact is very high on e-commerce, SaaS and membership-based platforms.
In addition, User-ID does not stitch historical data retroactively. It ensures data integrity from the date it is activated.
Why Is It So Important?
Cross-device tracking is not a technical detail; it is a strategic data architecture.
With it:
- You see the real number of users
- You measure the real conversion rate
- Funnel analyzes become meaningful
- Customer lifetime value (LTV) is calculated more accurately
- Marketing budget is optimized more soundly
The most dangerous thing in analytics is not missing data but misleading data. Wrong identity stitching produces wrong decisions, and wrong decisions cost budget.
When set up correctly, User-ID turns the fragmented touchpoints generated by devices into the real journey of a single person.
And when your measurement method changes, the reality you see changes too.
Let’s talk about this for your brand.
Write to us →