Ainfographie.com logo animé

Google Analytics 4 + WooCommerce ✅ Setup Enhanced Ecommerce

  1. Accueil
  2. Blog
  3. Tutoriels WordPress
  4. Google Analytics 4 + WooCommerce ✅ Setup Enhanced Ecommerce

How to setup Google Analytics 4 for your WooCommerce shop in WordPress? That’s simple! In this tutorial you’ll learn implementation of enhanced ecommerce tracking by using Google Tag Manager and the GTM4WP plugin.

Here is the link to the previous video, where we’ve already setup the basic Tag Manager container on our website and also the Google Analytics 4 Configuration Tag:
► Install GA4: https://youtu.be/JMjy7Vlp5-E

► Tag Manager documentation: https://developers.google.com/tag-manager/ecommerce-ga4

At the beginning, we first have to activate enhanced ecommerce tracking in our Google Tag Manager for WordPress plugin. You will find the checkbox in the WooCommerce tab of the plugin settings. This will automatically add all the necessary code on WooCommerce pages (e.g. product page) to push the WooCommerce data (e.g. product title, product price, …) to the datalayer.
Now that we are sending ecommerce data to Google Tag Manager (through the data layer), we of course have to read that data and process it. And therefore, we first create all the variables in Google Tag Manager [GTM] that we want to read from the datalayer. Afterwards, we create a new tag of type “GA4 Event” since the ecommerce tracking is a set of events. And in this event, we select the variables which we want to process (so, all of those that we created before). The next step is setting a trigger for the tag. And of course, we want the tag to always fire when a new ecommerce event occurs (e.g. user goes to checkout: Event=begin_checkout). So for the trigger we write down all of these events and separate them with a vertical bar. Now we can save everything and run the test in the TagAssistant. And when the test is succesfull the only thing left, is to publish all changes.

ecommerceItems variable:

function() {
var ecom = {{datalayer – ecommerce}};
if (ecom && ecom.items) {
return ecom.items;
} else {
return undefined;
}
}

#GoogleAnalytics #WooCommerce #EnhancedEcommerce

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
???? I need your support. Yes, YOU can help me (if you want it).

If I helped you, I would really appreciate it if you subscribe to my channel, leave a comment ???? and hit the like button ????
► Subscription-Link: https://www.youtube.com/c/LeonRenner?sub_confirmation=1

00:00 Introduction
00:24 Activate enhanced ecommerce tracking in GTM4WP plugin
01:26 Define ecommerce variables in Google Tag Manager
07:29 Setup ecommerce event tag
10:03 Setup ecommerce event triggers
12:45 Preview and test implementation

Vous devez vous connecter pour publier un commentaire.
Menu