How to Enable Tracking by User ID in WooCommerce

Enhanced Ecommerce Google Analytics for WooCommerce can send each logged-in customer's WordPress User ID to Google Analytics 4 alongside their pageviews and events. GA4 uses this to tie sessions together for the same person, even if they visit your store from different devices or browsers.

Once enabled, the plugin passes the WordPress User ID (a numeric ID) as GA4's user_id  parameter for any logged-in visitor.

Benefits

Enabling User ID tracking can help:

  • See a more accurate picture of returning customer behavior, across devices and browsers
  • Reduce the inflated session counts that come from treating each device as a separate visitor
  • Build reports around real customers rather than individual sessions

How It Works

When a logged-in user browses your store, the plugin sends their WordPress User ID as the user_id  parameter in the GA4 tracking call. GA4 can then use this ID to stitch together sessions from the same person, whether they're on their phone today and their laptop tomorrow.

This only applies to logged-in users. Guests and visitors who aren't signed in don't have a User ID to send, so their sessions are tracked normally without this stitching.

How to Enable User ID Tracking

Step 1: Turn on User ID Tracking in the plugin

Go to Ecommerce Tracking → Tracking Configuration, open Core Tracking, and turn on User ID Tracking. Save your settings.

Step 2: Enable User-ID reporting in GA4

For GA4 to actually use the User ID for cross-device reporting, you also need to turn on User-ID as a reporting identity in your GA4 property. In GA4, go to Admin → Reporting Identity (under your property's data settings) and make sure User-ID is included as an identity method.

Without this step on the GA4 side, the User ID is still sent with each event, but GA4 won't use it to merge sessions across devices in reports.

Example Use Cases

Understanding repeat customers: If you want to see how a returning customer behaves across visits, User ID tracking lets GA4 group those sessions together instead of counting them as separate, disconnected users.

Cross-device shopping journeys: If customers browse on mobile and complete checkout on desktop, this setting helps GA4 recognize it's the same person rather than two unrelated sessions.

Cleaner user counts: If your analytics is overcounting unique users due to device switching, enabling this can bring your reported user counts closer to actual customer counts.

Conclusion

User ID Tracking sends each logged-in customer's WordPress User ID to GA4, giving Google Analytics what it needs to connect that person's activity across sessions and devices. Turn on the toggle in the plugin, then confirm User ID is enabled as a reporting identity in your GA4 property to get the full benefit.

FAQs

1. Does this track guest (not logged-in) visitors?

No. Only logged-in WordPress users have a User ID to send. Guest sessions are tracked as usual, without this cross-device linking.

2. What ID does GA4 actually receive?

The visitor's numeric WordPress User ID, sent as GA4's user_id  parameter.

3. Do I need to change anything in GA4 itself?

Yes. Turning on the plugin toggle sends the ID, but GA4 needs User ID enabled as a reporting identity to use it for cross-device session stitching in reports.

4. Is any personal information like name or email sent to GA4?

No. Only the numeric WordPress User ID is sent as part of this feature, not the customer's name, email, or other personal details.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.