WordPress

How to Enable Customer Tracking in WooCommerce with Google Analytics

Published on 21. February, 2023

Do you want to enable customer tracking in WooCommerce?

Customer tracking allows you to offer a personalized shopping experience based on customer behavior in your eCommerce store.

In this article, we will show you how to easily enable customer tracking in WooCommerce with Google Analytics.

Why Enable Customer Tracking in WooCommerce with Google Analytics?

Google Analytics allows you to see where your visitors are coming from and what they do on your website. In other words, it helps you track your traffic sources as well as user engagement on your website.

For eCommerce platforms, Google Analytics offers an enhanced eCommerce tracking feature. This allows you to better understand users’ shopping and checkout behavior. Plus, you can see which products perform the best and track your WooCommerce store’s sales performance.

By default, a WooCommerce store allows your customers to create an account or checkout as guest users. Creating an account helps the user save their shipping and billing information for faster checkout next time. It also helps you offer customers a personalized shopping experience based on their browsing and shopping history.

Wouldn’t it be great if you could track logged-in users with their user IDs in Google Analytics and also see the path customers took before making a purchase?

This will give you access to a treasure trove of information and insights on customer behavior. You can use it to offer a better on-site experience and boost your sales.

Let’s take a look at how to easily enable customer tracking in WooCommerce. Here are quick links that you can use to jump ahead to any section:

Set up Ecommerce Tracking in WordPress with Google Analytics

The best way to set up WooCommerce customer tracking in Google Analytics is using Monsterinsights. It is the best Analytics solution for WordPress and helps you set up tracking without editing code.

The plugin offers an eCommerce addon, which automatically detects WooCommerces and starts tracking customer behavior in Google Analytics. It also comes with a Customer Journey addon that allows you to see users’ behavior before they make a purchase.

First, you will need to install and activate the MonsterInsights plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

You will need to be on the ‘Pro’ plan to access the eCommerce and User Journey addon, which we will use for this tutorial. However, there is also a MonsterInsights Lite version you can use for free.

Upon activation, you will see the welcome screen and the setup wizard. Simply click the ‘Launch the Wizard’ button and follow the on-screen instructions.

Launch setup wizard

For detailed instructions, see our article on how to install Google Analytics in WordPress.

MonsterInsights also helps you set up Google Analytics 4 (GA4) property through its Dual Tracking feature. GA4 is the latest Analytics version, and it will soon replace Universal Analytics.

MonsterInsights Dual Tracking GA v4

If you haven’t created a Google Analytics 4 property, then now is the best time. That’s because, after July 1, 2023, Universal Analytics will sunset and won’t track your website data. Setting up GA4 after the sunset date will mean you’ll have to start from scratch and won’t have any historical data for comparison.

For more details, please see our guide on how to switch to Google Analytics 4 in WordPress.

Install the MonsterInsights eCommerce Addon

Once you’ve configured Google Analytics on your website, the next step is to install the eCommerce addon.

You need to visit the Insights » Addons page from your WordPress dashboard and navigate to the ‘eCommerce’ addon. Simply click the ‘Install’ button, and the addon will automatically activate.

Install the eCommerce addon

Enable Enhanced Ecommerce Tracking in Google Analytics

The next step is to enable eCommerce tracking in Google Analytics. E-commerce tracking is not enabled by default in your Google Analytics account, and you will have to manually enable it.

First, you’ll need to head over to your Google Analytics account dashboard and click the Admin option.

Click the admin settings button

Next, you need to click on the ‘Ecommerce Settings’ option.

It is located under the View column.

Ecommerce settings

On the settings page, click the slider under Enable Ecommerce and Enable Enhanced Ecommerce Reporting to turn it on.

Don’t forget to click the ‘Save’ button when you’re done.

Enable ecommerce and enhanced ecommerce reporting

Now, your Google Analytics account will start showing enhanced eCommerce reports for your WooCommerce store.

For more details, please see our guide on how to set up WooCommerce conversion tracking.

Enabling User Journey Addon in MonsterInsights

Now that you’ve set up WooCommerce tracking in Google Analytics, the next step is to enable the MonsterInsights Customer Journey addon.

The addon will allow you to see the steps a customer takes before making a purchase in WooCommerce. Plus, it also shows the time it took at each step, the pages a user visited, and more.

First, you’ll need to go to Insights » Addons from your WordPress admin panel. Next, navigate to the User Journey addon and click the ‘Install’ button.

Install the user journey addon

The addon will automatically activate and start tracking your WooCommerce customer’s journey.

Next, you can go to WooCommerce » Orders from your WordPress dashboard to view the path your customers took when purchasing a product.

WooCommerce order select

After that, click on the order for which you’d like to see the user journey.

On the next screen, you’ll see the path a customer took before buying the product. You get to view the pages they visited, where they clicked, and how much time they spent on a page.

User journey in MonsterInsights

This is really useful information to better understand your customers. You can see which product categories are performing the best and where customers are exiting your store during the purchase process. Using the data, you can then fix these issues and optimize your site for more conversions.

Enabling User ID Tracking in Google Analytics

While MonsterInsights makes it very easy to track customers on your WooCommerce store, it also tracks WordPress ID tracking in Google Analytics.

WordPress ID is a unique ID to identify every user on your website. The user ID is called the ‘Client ID’ in Universal Analytics and the ‘App Instance ID’ in Google Analytics.

Do remember that enhanced eCommerce tracking will enable eCommerce reporting features for your WooCommerce store. However, it does not enable user tracking by default.

Let’s take a look at how you can enable user ID tracking in Universal Analytics and Google Analytics 4.

Enabling Customer Tracking in Universal Analytics

To enable individual customer tracking, you need to visit your Google Analytics account dashboard and open the Admin page.

Click the admin settings button

Now, click on the ‘Tracking info’ link under the Property column to expand the submenu.

After that, you can click the User-ID link that appears below.

Go to user ID settings

On the next page, you’ll have to review and agree to the User-ID policy.

Simply click the ‘I agree to the User-ID Policy’ toggle to turn it on.

Enable the user ID feature

From here, click on the ‘Next step’ button to continue.

Google Analytics will now ask how you would like to configure the user-ID tracking.

Copy the user id code

Since you’ll be using MonsterInsights, there’s no need to set up the user-ID tracking code. The plugin will take care of this for you.

Simply scroll down and click the ‘Next step’ button to continue.

Head to the next step

Next, you will see information about creating a user ID view in Google Analytics.

Go ahead and click the ‘Create’ button.

Create user-id view

After that, you will be asked to enter a ‘Reporting View Name’, which will be used to display User ID reports.

We recommend including UserID in the name, so it is easy to remember which view has UserID tracking enabled.

Enter a reporting view name

There is also an option to select the Reporting Time Zone.

Next, you just need to scroll down to the bottom and click on the ‘Create view’ button to save it.

Select timezone and create view

Enabling Customer Tracking in Google Analytics 4

To start, you’ll need to go to the Admin settings from your GA4 dashboard and click the ‘Reporting Identity’ option.

Open reporting identity settings

On the next screen, you will need to select a way to identify users on your online store.

GA4 uses multiple ways to identify customers. These include user ID, Google signals, device ID, and modeled data. For the sake of this tutorial, we’ll select the ‘Observed’ option and click the ‘Save’ button.

Select observed option in reporting identity

Viewing Customer Tracking Reports in Google Analytics

Now that everything is set up, Google Analytics will now track all your website customers. It will also be able to track logged-in users with their unique WordPress user ID.

View User ID Data in Universal Analytics

To view all your individual customer activity, you can go to your Universal Analytics account and click on the Audience » User Explorer menu.

View user explorer client ID in UA

You will see individual customer reports with a unique ID assigned to all non-logged-in users.

To view customer tracking reports for logged-in users in WooCommerce, you need to click on the Google Analytics logo on the top left corner of the screen.

This will show all your Google Analytics profiles. You will see your website profile and under ‘All website data’ you will see the UserID reporting view you created earlier.

Select UA User ID view

Go ahead and click on the UserID reporting view to load it.

Once it’s loaded, you need to click on the Audience » User Explorer menu. This way, you will see a logged-in customer tracking report where each user is represented by their WordPress user ID on your website.

UA user explorer user ID report

You can click on the user ID to view a customer’s individual tracking data.

For instance, the device category they use, acquisition date, the channel they used to arrive on the online store, and more.

UA user explorer user id details

View User ID Data in Google Analytics 4

In Google Analytics 4, you’ll need to head to the ‘Explore’ tab from the menu on your left.

Under Explorations, you’ll see different report templates. Simply click the existing ‘User explorer’ report.

Select user explorer report

Next, you’ll see the User explorer report in Google Analytics 4.

One thing you can notice is the Client ID will be replaced with the App instance ID.

See user explorer report in ga4

You can click on any of the app instance IDs to view more details.

For example, the report shows the total events that were triggered, the location of the user, the time stamp for each event, and more.

View details of app instance ID

Matching Customer Tracking with Their WordPress Accounts

Now that you’ve identified users in Google Analytics, you can match them with WordPress accounts. This will help you know who this customer is, and how you can create personalized offers, emails, or shopping experiences for them.

First, you need to note down the customer ID you see in your Google Analytics User-ID reporting view.

After that, go to your WordPress website’s admin area and click on the ‘Users’ menu. It will show you a list of all users on your WordPress site.

Next, you can click the ‘Edit’ link below any username in the list.

Edit any user profile

WordPress will now open the user profile for you.

If you look in your browser’s address bar you will ‘user_id’ parameter in the URL.

User ID in URL

Next, you need to replace the value next to user_id with the one you copied from your Google Analytics report and press enter key on your keyboard.

WordPress will now load the user profile associated with that particular User ID. You now have the customer’s name, username, email address, and social media information. You can also track their orders, product views, cart activity, and more.

OceanWP - a free Multi-Purpose WordPress theme