Enhanced eCommerce Setup
To create a variable in Google Tag Manager, go to its dashboard and click on the Variables:

Next, click on the New button from the User-Defined Variables to add a variable.
In the next screen, enter the variable name asΒ β Google Analytics Tracking ID GA3
Now, hover over the Variable Configuration section and click on the pencil-like icon.
In the Choose variable type screen, scroll down and choose the variable type asΒ β Google Analytics Settings:

Next,Β enter the Google Analytics Tracking ID that you have copied from the third step of GA4 setup using GTMο»Ώ.
After these, let the Cookie Domain beΒ auto.
After these configurations, your screen should look something like the below β

Once you are done with creating variables, it is now time to create tags in the Google Tag Manager For GA3.
From your workspace, click on the Tags option and then click on the New button.

Configure a tag with the details as displayed below:

- Enter the tag title βΒ GA3 Configuration
- Under Tag Configuration, click on the pencil-like icon and then choose tag type as βΒ Google Analytics: Universal Analytics
- Track Type as βΒ Page View
- For Google Analytics Settings, choose the variable created in the previous step i.e. Google Analytics Tracking ID GA3.
- Under Triggering, click on the pencil-like icon and then choose tag type as βΒ All Pages
- Click on the Save button from the top-right corner.
Now let's create a tag for Add to Cart event as per the below steps:

- Enter the tag title βΒ GA3 addToCart.
- Under Tag Configuration, click on the pencil-like icon and then choose tag type as βΒ Google Analytics: Universal Analytics
- Track Type as βΒ Event
- Enter Category as βΒ Enhanced Ecommerce
- Under Action write βΒ addToCart
- Keep Non-Interaction Hit as βΒ True
- For Google Analytics Settings, choose the variable created in the previous step i.e. Google Analytics Tracking ID GA3
- Tick the Enable overriding settings in this tag checkbox.
- Now, under More Settings, scroll down to Ecommerce and set Enable Enhanced Ecommerce Features as True.
- Tick the Use Data Layer checkbox.
Now, under Triggering, click on the pencil-like icon and then click on the β+β icon to add a trigger.

In the next screen, enter the trigger details below:
- Enter trigger name as β GA3 addToCart
- Under the Trigger Configuration, click the pencil-like icon and then choose the trigger type as β Custom Event
- Write Event Name as β addToCart
- Under βThis trigger fires onβ select βΒ All Custom Events
- Click on the Save.
Your Trigger Screen should look like the below β

Similarly, you can create other tags and triggers with the same setting. All you have to do is follow the below table:
Tag Title | Action (Tag) | Trigger Names | Event Name (Trigger) |
GA3 impressions | productImpression GA3 impressions productImpression | GA3 impressions | productImpression GA3 impressions productImpression |
GA3 productClick | productClick | GA3 productClick | productClick |
GA3 productdetail | productdetail | GA3 productdetail | productdetail |
GA3 addToCart | addToCart | GA3 addToCart | addToCart |
GA3 removeFromCart | removeFromCart | GA3 removeFromCart | removeFromCart |
GA3 checkout | checkout | GA3 checkout | checkout |
GA3 purchase | checkout-complete | GA3 purchase | checkout-complete |
GA3 checkout_option | checkout_option | GA3 checkout_option | checkout_option |
We need to create 3 variables for GA4 in the Google Tag Manager. For this, go to its dashboard and click on the Variables:

Next, click on the New button from the User-Defined Variables to add a variable.
Variable 1 - Ecommerce Transaction ID
- In the next screen, enter the variable name asΒ β Ecommerce Transaction ID
- Now, hover over the Variable Configuration section and click on the pencil-like icon.
- In the Choose variable type screen, choose the variable type asΒ β Data Layer Variable:

- Enter the Data Variable Name as - ecommerce.purchase.actionField.id
- In Data Layer Version, select Version 2 from the drop down and click on the Save button.
Variable 2 - Ecommerce Revenue
- Click on the New button from the User-Defined Variables to add the new variable.
- In the next screen, enter the variable name asΒ β Ecommerce Revenue
- Now, hover over the Variable Configuration section and click on the pencil-like icon.
- In the Choose variable type screen, choose the variable type asΒ β Data Layer Variable.
- Enter the Data Variable Name as - ecommerce.purchase.actionField.revenue
- In Data Layer Version, select Version 2 from the drop-down and click on the Save button.

Variable 3 - GA4 Ecommerce DataLayer
- Click on the New button from the User-Defined Variables to add the variable.
- In the next screen, enter the variable name asΒ β GA4 Ecommerce DataLayer
- Now, hover over the Variable Configuration section and click on the pencil-like icon.
- In the Choose variable type screen, choose the variable type asΒ β Data Layer Variable.
- Enter the Data Variable Name as - ecommerce.items
- In Data Layer Version, select Version 2 from the drop-down and click on the Save button.

Once you are done with creating variables, it is now time to create tags in the Google Tag Manager For GA4.
From your workspace, click on the Tags option and then click on the New button.

Configure a tag with the details as displayed below:

- Enter the tag title βΒ Google Tag
- Under Tag Configuration, click on the pencil-like icon and then choose tag type as βΒ Google Tag
- Enter the Measurement ID that you have copied from the third step of the GA4 setup using GTMο»Ώ in the Tag ID field.
- Under Triggering, click on the pencil-like .icon and then choose tag type as βΒ All Pages.
- Click on the Save button from the top-right corner.
Now let's create a tag for Add to Cart event as per the below steps:

- Enter the tag title βΒ GA4 Add to Cart
- Under Tag Configuration, click on the pencil like icon and then choose tag type as βΒ Google Analytics: GA4 Event
- Enter the Measurement ID that you have copied from the third step of the GA4 setup using GTMο»Ώ in the Tag ID field.
- Under Event Name write βΒ add_to_cart
- Now, click on the Event Parameters and then on Add Row button.
- Parameter Name - items
- Value - click on plus icon and select the "GA4 Ecommerce DataLayer" variable.
Now, under Triggering, click on the pencil like icon and then click on the β+β icon to add a trigger.

In the next screen, enter the trigger details as below:
- Enter trigger name as β GA4 Add to Cart
- Under the Trigger Configuration, click the pencil like icon and then choose the trigger type as β Custom Event
- Write Event Name as β add_to_cart
- Under βThis trigger fires onβ select βΒ All Custom Events
- Click on the Save.
Your Trigger Screen should look like the below β

Similarly, you can create 5 other tags and triggers with the same setting. All you have to do is follow the below table:
Tag Title | Action (Tag) | Trigger Names | Event Name (Trigger) |
View Item List | view_item_list GA3 impressions productImpression | View Item List | view_item_list GA3 impressions productImpression |
Select Item | select_item | Select Item | select_item |
View Item | view_item | View Item | view_item |
Remove from Cart | remove_from_cart | Remove from Cart | remove_from_cart |
Begin Checkout | begin_checkout | Begin Checkout | begin_checkout |
Now, the next three tags are IMPORTANT for generating data at Google Analytics. So, let's start creating the first tag for purchase event as per the below steps:

- Enter the tag title βΒ GA4 Purchase
- Under Tag Configuration, click on the pencil like icon and then choose tag type as βΒ Google Analytics: GA4 Event
- Enter the Measurement ID that you have copied from the third step of the GA4 setup using GTMο»Ώ in the Tag ID field.
- Under Event Name write βΒ purchase
- Now, click on the Event Parameters and then add 4 rows by clicking on Add Row button. Add the parameters below:
Parameter | Value |
value | select variable - Ecommerce Revenue |
transaction_id | select variable - Ecommerce Transaction ID |
currency | enter - USD |
items | select variable - GA4 Ecommerce DataLayer |
Now, under Triggering, click on the pencil like icon and then click on the β+β icon to add a trigger.

In the next screen, enter the trigger details as below:
- Enter trigger name as β GA4 Purchase
- Under the Trigger Configuration, click the pencil like icon and then choose the trigger type as β Custom Event
- Write Event Name as β purchase
- Under βThis trigger fires onβ select βΒ All Custom Events
- Click on the Save.
Your Trigger Screen should look like the below β

You can create a tag for "Add Shipping Info" event as displayed below images and save the settings:
- Enter the tag title βΒ GA4 add_shipping_info
- Under Tag Configuration, click on the pencil like icon and then choose tag type as βΒ Google Analytics: GA4 Event
- Enter the Measurement ID that you have copied from the third step of the GA4 setup using GTMο»Ώ in the Tag ID field.
- Under Event Name write βΒ add_shipping_info

Now, under Triggering, click on the pencil like icon and then click on the β+β icon to add a trigger.

In the next screen, enter the trigger details as below:
- Enter trigger name as β GA4 add_shipping_info
- Under the Trigger Configuration, click the pencil like icon and then choose the trigger type as β Custom Event
- Write Event Name as β add_shipping_info
- Under βThis trigger fires onβ select βΒ All Custom Events
- Click on the Save.

Similarly, create a tag for "Add Payment Info" event and save the settings:
- Enter the tag title βΒ GA4 add_payment_info
- Under Tag Configuration, click on the pencil like icon and then choose tag type as βΒ Google Analytics: GA4 Event
- Enter the Measurement ID that you have copied from the third step of the GA4 setup using GTMο»Ώ in the Tag ID field
- Under Event Name write βΒ add_payment_info

Now, under Triggering, click on the pencil like icon and then click on the β+β icon to add a trigger.

In the next screen, enter the trigger details as below:
- Enter trigger name as β GA4 add_payment_info
- Under the Trigger Configuration, click the pencil like icon and then choose the trigger type as β Custom Event
- Write Event Name as β add_payment_info
- Under βThis trigger fires onβ select βΒ All Custom Events
- Click on the Save.

ο»Ώ