Warning: Attempt to read property "permalink" on bool in /home/customer/www/ecommercetrends.co/public_html/wp-content/plugins/wordpress-seo/src/context/meta-tags-context.php on line 297
Ecommerce Trends Ecommerce Trends, a blog regularly updated with trends in the eCommerce & marketing industry. The authors of this blog have decades of experience in their fields. Readers can seek extremely valuable information on Ecommerce Trends & Digital Marketing Strategies.

Essential Guide for GA4 Ecommerce Tracking via GTM

4 min read

Guide for GA4 Ecommerce Tracking via GTM

Google Analytics 4 or GA4 eCommerce tracking is one of the most popular and essential integrations for all businesses operating online. Moreover, if you are planning to take your business to the next level, relying on the Google tag manager data layer eCommerce is the ultimate solution.

It won’t be wrong to say that GA4 eCommerce tracking is not just any typical software upgrade. With the older versions, businesses worked with enhanced eCommerce features. Unfortunately, it is not a part of GA4 Google analytics.

The Google tag manager data layer eCommerce is popular because it is a completely different platform. According to market experts, setting and using the GA4 eCommerce tracking for an eCommerce site is not as simple as a toggle switch. It can be stressful, especially when not done in the right way.

Let us dig to understand the difference between universal analytics vs. Google analytics4 and the required details for GA4 eCommerce tracking via GTM.

Google Analytics – GA4 Ecommerce Tracking

Universal analytics used ‘enhanced eCommerce,’ which offers many powerful and superior features to the standard tracking. You will likely encounter a few differences if you switch from the enhanced eCommerce universal analytics to GA4 Google analytics.

Google Analytics uses different features to track different metrics like revenue, transaction details, average order, etc., which helps to measure the transparent performance of the campaigns, pricing, etc. The significant changes between universal analytics vs. Google analytics4′ mainly concerns the schemas and data layers.

Basic Configuration for GA4 Ecommerce Tracking –

The implementation steps for GA4 eCommerce are different from the previously available universal analytics. GA4 eCommerce tracking comes packed with many unavailable features. To begin, you should add GA4, creating a purchase data layer and product view data layer.

Understanding Data Layer Code –

Undoubtedly, the Google tag manager data layer is one of the most essential features in GA4 eCommerce tracking. It can be challenging to understand the concept of the Google tag manager data layer eCommerce, especially when you are not a developer. However, you should understand the concept to leverage its full advantage.

The Google tag manager data layer is an array of JavaScript to temporarily store the data needed by GTM for tags, variables, and triggers. After that, the data can be easily transferred to other Google tools for further use.

The data layer can be considered as a hidden virtual layer in GA4 eCommerce tracking for the website to store all the essential data. Since the data layer is not publicly visible and is visible only to the website owner, your website visitors won’t be able to see it.

Let us move to the next section of the article to understand the setting up of GA4 eCommerce tracking via GTM.

Related Technical Article- Importance of SEO-Friendly URL structure

Steps to Setup GA4 Ecommerce Tracking via GTM –

Here are the following steps to follow for convenient GA4 eCommerce tracking via GTM:

Visit your GTM account:

First things first, go to your GTM account. After this, select the ‘option variable’ on the left-hand taskbar.

Creating a new GTM Variable:

  • In the next step, scroll down till you reach user-defined variables. After reaching, click on the ‘New’ button available on the right of your screen.
New Variable in GTM
  • Provide an appropriate name to the GTM new variable like the GA4 eCommerce layer
  • Choose the variable configuration; it will open an overlay.
  • Now, click on the ‘Data Layer Variable’ option under the page variable

Complete the Variable Configuration for GA4 Ecommerce Tracking:

Simply complete all the required configuration details of the ‘Google tag manager data layer’ and then press the save button

variable Configuration in GTM for GA4 Ecommerce Tracking

Push the Code to the Data Layer:

Depending upon your needs or requirements, you need specific data layer codes to track specific parameters from your eCommerce store.

The below-mentioned code aims at tracking the ‘item lists’

// Measure product views / impressions
dataLayer.push({ eCommerce: null });  // Clear the previous eCommerce object.
dataLayer.push({
           		event: "view_item_list",
           		eCommerce: {
	       		items: [
{
   	    		item_name: "Triblend Android T-Shirt",       // Name or ID is required.
   	    		item_id: "12345",
  	     		price: 15.25,
   	    		item_brand: "Google",
   	    		item_category: "Apparel",
   	    		item_category2: "Mens",
   	    		item_category3: "Shirts",
   	    		item_category4: "Tshirts",
   	    		item_variant: "Gray",
   	    		item_list_name: "Search Results",
   	    		item_list_id: "SR123",
   	    		index: 1,
   	    		quantity: 1
 	      		
},
 	      		
{
   	    		item_name: "Donut Friday Scented T-Shirt",
   	    		item_id: "67890",
   	    		price: 33.75,
   	    		item_brand: "Google",
   	    		item_category: "Apparel",
   	    		item_category2: "Men's",
   	    		item_category3: "Shirts",
   	    		item_category4: "Tshirts",
   	    		item_variant: "Black",
   	    		item_list_name: "Search Results",
   	    		item_list_id: "SR123",
   	    		index: 2,
   	    		quantity: 1
 	      		
}]
}
});

The above example was mentioned by Google developers.

Google Tag Configuration Setup:

  • In your GTM account, go to the tag section and click on the button ‘create a new tag’
  • Give an appropriate name to the tag, and then click on the ‘tag configuration’ option
Google Analytics GA4 Event
  • Now, select the GA4 event tag. As soon as you select this, a tag configuration window will open
  • In the configuration tag field, select ‘manually set ID’
  • After this, add your GA4 measurement ID in the next field

For further convenience, you can also find this by following the path:

GA4 account > Admin > Data Streams > Domain

  • In the next step, click on the ‘event parameters’ section and click on the add row button
  • Now, add the items as the parameter name
  • Finally, click on the (+) box present on the value field and choose the data layer variable you created previously

Tag Trigger Configuration:

  • To begin with, click anywhere on the trigger section
  • Then choose the (+) icon available on the top right corner
  • Provide an appropriate trigger name, and then click on the trigger configuration section
  • Another overlay will appear. Scroll down until you see other section
  • Now, click on the ‘Custom Event’
Custom Events in GTM
  • Add the custom name that you will track
  • Select ‘Save’

As soon as you complete these steps, you can view the complete tag you created. While going through these steps for GA4 eCommerce tracking, ensure that every detail is correctly mentioned to avoid any errors.

Final Thoughts:

Once you have completely set up the Google tag manager data layer eCommerce, be patient to collect enough data to make strategic conclusions for your business. After you have enough business data, you can then rely on the GA4 eCommerce tracking to analyze, track and share important and needed insights.

While using GA4 Google analytics, remember that it is still updating itself with new features from time to time. You may miss some features in comparing universal analytics vs. Google analytics4, GA4 eCommerce analytics is yet to reach its peak.If you still have any more doubts or concerns regarding the GA4 eCommerce tracking, please write to us in the comment section. We will assist you with the required details to reach the desired solution.

Related Technical Article: How to Better Fix Robots Meta Tag and Robots.txt

Ecommerce Trends Ecommerce Trends, a blog regularly updated with trends in the eCommerce & marketing industry. The authors of this blog have decades of experience in their fields. Readers can seek extremely valuable information on Ecommerce Trends & Digital Marketing Strategies.