top of page

How To Track E-Commerce Events In GA4 Via GTM

Google Analytics 4 (GA4) is the latest version of Google Analytics that provides you with a more comprehensive view of your website's data. It comes with advanced features and functionalities that help you analyze your website traffic and make better business decisions.



One of the key benefits of GA4 is the ability to track e-commerce events, such as product purchases and cart additions. In this blog, we will explore how to track e-commerce events in GA4 using Google Tag Manager (GTM).


Step 1: Set up GA4 in Google Tag Manager


The first step in tracking e-commerce events in GA4 is to set up GA4 in GTM. If you have already set up GA4 in GTM, skip this step. To set up GA4 in GTM, follow these steps:


  • Log in to your GTM account and navigate to the "Tags" section.

  • Click on the "New" button and select "Google Analytics: GA4 Configuration" from the list of tag templates.

  • Enter your GA4 measurement ID in the "Measurement ID" field.

  • Enable the "Enable Enhanced Measurement" option.

  • Click on the "Triggering" section and select the trigger that fires on all pages of your website.

  • Save your tag and publish your changes.


Step 2: Set up e-commerce tracking in GA4


The next step is to set up e-commerce tracking in GA4. To do this, follow these steps:


  • Log in to your GA4 account and navigate to the "Events" section.

  • Click on the "Configure Events" button and select "E-commerce" from the list of event templates.

  • Enable the "Purchase" and "Add to cart" options.

  • Click on the "Done" button to save your changes.


Step 3: Create a trigger for e-commerce events


The third step is to create a trigger that fires when an e-commerce event occurs. To create a trigger, follow these steps:


  • Navigate to the "Triggers" section in GTM.

  • Click on the "New" button and select "Custom Event" from the list of trigger templates.

  • Enter a name for your trigger.

  • Set the trigger type to "Event."

  • Set the trigger to fire when the "event name" equals "purchase" or "add_to_cart."

  • Save your trigger.


Step 4: Create a tag for e-commerce events


The fourth step is to create a tag that sends e-commerce event data to GA4. To create a tag, follow these steps:


  • Navigate to the "Tags" section in GTM.

  • Click on the "New" button and select "Google Analytics: GA4 Event" from the list of tag templates.

  • Enter a name for your tag.

  • Select your GA4 configuration tag from the "Tag Configuration" section.

  • Set the "Event Name" field to "purchase" or "add_to_cart" depending on the e-commerce event you want to track.

  • Set the "Triggering" section to your e-commerce event trigger.

  • Save your tag.


Step 5: Test your setup


The final step is to test your e-commerce event tracking setup. To test your setup, follow these steps:


  • Navigate to your website and add a product to your cart.

  • Check the GTM preview panel to confirm that your e-commerce event trigger fires and your GA4 event tag send data to GA4.

  • Check your GA4 account to confirm that your e-commerce


To consult about Google Analytics & Tracking for your Business, Book our Online Consultation here.




8 views0 comments
Post: Blog2_Post
bottom of page