How to integrate Google Analytics GA4 with WooCommerce?

GA4 is the name of a new type of Google Analytics property that comes with a new UI and features to analyze customers’ behavior in an eCommerce shop. This guide shows how to integrate WooCommerce shop with GA4 using GTM Ecommerce for WooCommerce plugin.

GA4 with WooCommerce data

1. Install and configure GTM Ecommerce for WooCommerce plugin

First, make sure that GTM Ecommerce for WooCommerce plugin is up and live in your WooCommerce shop.

You can follow this guide in case of doubts.

2. Prepare Google Analytics GA4 property

Next prepare a new GA4 property and obtain the GA4 Measurement ID.

Once it is ready, go to your GA4 property, click the gear icon in the bottom left, and select Data Streams. If you haven’t done that before you will need to create a new Web stream. Once you are in the correct stream, copy the Measurement ID.

3. Download GA4 preset

After that navigate back to your WordPress instance and go to Settings > GTM Ecommerce. These are the settings of our plugin and if you scroll to the bottom you will find a dropdown with a few GTM container presets. Select Google Analytics 4 (Basic) and click Download Preset. That will download and save ga4-basic.json file to your computer.

4. Import GA4 preset

The next step is to import the preset you have just downloaded into your GTM Workspace.

Navigate to GTM Workspace and go to Admin > Import container. In the new screen select the ga4-basic.json file and your Workspace (usually default one). Next select Merge as the import option and Overwrite conflicting tags, triggers and variables. as the sub-option. It’s very important to make sure those two options are selected.

Import screen gives you a quick way to preview all the changes import will make to your workspace. Now you can click Confirm. This will bring the changes as draft so you will have opportunity to review and adjust everything before going live.

5. Update GTM container and publish it!

The last step is to find the GA4 Measurement ID variable. It can be found on the overview screen that shows all the changes you have just imported, or on the Variables list.

Open this variable and edit it’s value pasting the Measurement ID for your GA4 property.

Save the change and publish everything to your end users!

You can confirm data is tracked in GA4 realtime screen.

Realtime view of ecommerce data in GA4