Table of Contents
Step-by-step Guide on How to set up Ecommerce Tracking in GA4
Step 1: Create a GA4 Property
If you haven’t already, create a GA4 property for your website by logging into your Google Analytics account and clicking on “Create Property”. Fill in the required information, such as your website name and URL, and select the type of data you want to track (e.g. website, app).
Step 2: Enable Ecommerce Tracking in GA4
Once you have created a GA4 property, navigate to the “Data Streams” section and click on the “Add Stream” button. Choose “Web” as the data stream type and provide a name for your data stream.
Step 3: Add the GA4 Tracking Code to Your Website
Next, add the GA4 tracking code to your website. You can find the tracking code in your GA4 property under “Admin > Data Streams > Web Data Stream > Measurement ID”. Copy the code and add it to your website, either by adding it directly to the HTML of your site or by using a tag management solution like Google Tag Manager.
Install code directly on the website:
Admin > Data Stream > View tag instructions > Install manually
Notes: Code should be Installed just after starting <head> tag as per instructions.
Step 4: Install Google Tag Manager (GTM)
Login to Google Tag Manager Account. Create a New account if you don’t have a GTM account.
Now go to your account setting > Install google tag manager > copy code and paste as per instructions.
Now, you have to create Events, Tags, Triggers, Parameters, Variables
How to Setup Ecommerce Tracking through Google Tag Manager (GTM) in GA4?
Google Tag Manager (GTM) is a tool that allows you to manage and track various tags on your website, such as Google Analytics, AdWords conversion tracking, and other third-party tracking tags. To use GTM effectively, it’s important to understand some key terms and concepts, including events, tags, triggers, variables, and parameters.
1. Events: An event in GTM refers to any interaction that takes place on your website, such as a button click, page load, or form submission. Events are used to trigger tags in GTM, allowing you to track specific actions on your site.
2. Tags: A tag in GTM is a snippet of code that performs a specific tracking or marketing function, such as tracking a conversion or displaying an ad. In GTM, you can add and manage multiple tags for your website in one central location.
3. Triggers: A trigger in GTM determines when a tag should fire, or execute. Triggers are created by defining a specific event and conditions for when the event should trigger the tag. For example, you can create a trigger that fires a tag when a user clicks on a specific button on your site.
4. Variables: A variable in GTM is a placeholder for a value that can change. Variables can be used to store information, such as the URL of the current page or the value of a form field. Variables in GTM can be used in triggers and tags to dynamically track information on your site.
5. Parameters: A parameter in GTM is a value that is passed to a tag or variable. Parameters can be used to provide additional information to the tag or variable, such as the value of a form field or the ID of a product being viewed.
Google Documentation on Google Tag Manager
Now follow the following steps to set up your Ecommerce Tracking:
Step 1: Login into GTM Account
Step 2: Create GA4 Event
Name Tag – GA4 Configuration
Tag Configuration – Google Analytics: GA4 Configuration
Triggering – All Pages
Step 3: Go to variables and Click to New to create new variables
Step 4: Create a list of variables as shown below
Variable list and Data Layer Name
Variable name – (GA Ecommerce Item List ID)
Data Layer Name – (item_list_id)
Similarly, create the Following variables and Data Layer Names:
Variable name – (GA4 Ecommerce Affiliation)
Data Layer Name – (ecommerce.affiliation)
Variable name – (GA4 Ecommerce Coupon)
Data Layer Name – (ecommerce.coupon)
Variable name – (GA4 Ecommerce currency)
Data Layer Name – (ecommerce.currency)
Variable name – (GA4 Ecommerce Item List Name)
Data Layer Name – (item_list_name)
Variable name – (GA4 Ecommerce Items)
Data Layer Name – (ecommerce.items)
Variable name – (GA4 Ecommerce Shipping)
Data Layer Name – (ecommerce.shipping)
Variable name – (GA4 Ecommerce Tax)
Data Layer Name – (ecommerce.tax)
Variable name – (GA4 Ecommerce Transaction ID)
Data Layer Name – (ecommerce.transaction_id)
Variable name – (GA4 Ecommerce Value)
Data Layer Name – (ecommerce.value)
Variables to be created:
Step 5: Create a list of Trigger as shown below
Trigger name – GA4 Add To Cart
Event Name – add_to_cart
Similarly, create the following triggers
Trigger name – GA4 Begin Checkout
Event Name – begin_checkout
Trigger name – GA4 E-commerce Item List ID
Event Name – item_list_id
Trigger name – GA4 Ecommerce Products Impression
Event Name – view_item_list
Trigger name – GA4 E-commerce Refund
Event Name – refund
Trigger name – GA4 Product Clicks
Event Name – select_item
Trigger name – GA4 Purchase
Event Name – purchase
Trigger name – GA4 Remove From Cart
Event Name – remove_from_cart
Trigger name – GA4 View Item
Event Name – view_item
Triggers to be created:
Step 6: Tags to be created: Create a List of Tags as suggested below
1. Tag Name – All Page Click
Tag Configuration – GA4 Configuration
Trigger Name – All Pages
Similarly, create the following tags:
2. Tag Name – All Page Initialization
Tag Configuration – GA4 Configuration
Trigger Name – Initialization – All Pages
3. Tag Name – All Page View
Tag Configuration – GA4 Configuration
Trigger Name – All Pages
4. Tage Name – GA4 Add To Cart
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – add_to_cart
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 Add To Cart’
Similarly, create the following Tags-
5. Tag Name – ‘GA4 Begin Checkout
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – begin_checkout
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 Begin Checkout
More Settings – Send Ecommerce Data
6. Tag Name – ‘GA4 E-commerce Item List ID’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – item_list_id
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 E-commerce Item List ID’
More Settings – Send Ecommerce Data
7. Tag Name – ‘GA4 E-commerce Product Impressions’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – view_item_list
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 E-commerce Product Impressions’
More Settings – Send Ecommerce Data
8. Tag Name – ‘GA4 E-commerce Purchase’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – purchase
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 Purchase’
More Settings – Send Ecommerce Data
9. Tag Name – ‘GA4 E-commerce Refund’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – refund
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 E-commerce Refund’
More Settings – Send Ecommerce Data
10. Tag Name – ‘GA4 Product Clicks’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – select_item
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 Product Clicks’
More Settings – Send Ecommerce Data
11. Tag Name – ‘GA4 Remove From Cart
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – remove_from_cart
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 Remove From Cart
More Settings – Send Ecommerce Data
12. Tag Name – ‘GA4 View Cart
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – view_cart
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 View Cart
More Settings – Send Ecommerce Data
13. Tag Name – ‘GA4 View Item’
Tag Type – GA4 Event
Configuration Tag – GA4 Configuration
Event Name – view_item
Event Parameter & Value – In ‘value’ select variables
Trigger – Select Trigger ‘GA4 View Item’
More Settings – Send Ecommerce Data
Step 7: Verify Your Ecommerce Tracking Setup
Once you’ve added the ecommerce tracking code to your website, it’s a good idea to verify that everything is set up correctly. To do this, you can use the GA4 Debugging and Verification tool. This tool allows you to preview the data being sent to GA4 and see if there are any issues with your tracking setup.
Step 8: View Your Ecommerce Data in GA4
Finally, once your ecommerce tracking is set up and verified, you can start viewing your ecommerce data in GA4. Go to the “Reports” section of your GA4 property and select “Ecommerce” from the left-side menu. You can then view various ecommerce reports, such as revenue, conversion rate, average order value, and more.
In conclusion, setting up ecommerce tracking in GA4 is a straightforward process that provides valuable insights into your business performance and customer behavior. By following the steps outlined in this guide, you can easily track your online sales and make data-driven decisions to grow your business.
Also Read: How and Why to upgrade to GA4 from Universal Analytics?