User ID

A User ID is a unique code your webshop gives to a customer when they log in. You send it to Google Analytics 4 (GA4) so it can see that visits on a phone and on a laptop belong to the same person. It is an analytics term, not a Google Ads setting.

The code should come from your own system, for example an internal customer number. It should never be an email address, a name or a phone number.

How it works for an ecommerce shop

Without a User ID, GA4 mostly relies on cookies and devices. One customer who browses on a phone and buys on a laptop can look like two people. With a User ID, GA4 can join those visits, but only when the customer is logged in.

The link to paid search is indirect. A cleaner view of the customer journey helps you judge how your ads really contribute. It can also give you a better read on cross-device conversions when you connect GA4 to Google Ads, as described on the Google Analytics (GA4) integration page.

A User ID is not the same as enhanced conversions or Customer Match. Those send hashed customer details to Google for matching. A User ID is an internal code used in your analytics.

Common mistakes

  • Sending personal data such as an email address as the ID. This breaks Google’s rules and privacy law.
  • Expecting it to work for guests. Many webshops allow guest checkout, so only part of your traffic gets an ID.
  • Setting the ID only on some pages or only after checkout, so earlier visits are not linked.
  • Using an ID that changes between sessions or differs between your shop and your app.
  • Ignoring consent. Check that your setup respects your cookie and consent choices.

What I would do

  • Use a stable internal customer ID from your shop database.
  • Send it as soon as the customer logs in, on every page and in every event.
  • Test it in GA4 DebugView before you rely on the data.
  • Encourage account creation at checkout if it fits your brand. More logins means more linked journeys.
  • Treat it as a reporting help. Keep your Google Ads conversion tracking and your first-party data strategy in good shape as well.

FAQ

Is a User ID the same as a Client ID?

No. A Client ID is created by GA4 in the browser and is tied to one browser or device. A User ID is created by you and follows a logged-in customer across devices.

Does a User ID improve my Google Ads bidding?

Not directly. It improves how GA4 connects visits and reports journeys. Your bidding still depends on the conversion data you have set up in Google Ads.