Digital Marketing
Google Tag Manager Integration

Enhanced eCommerce Setup

22min
enhanced ecommerce setup for ga4 1 1 create variables in google tag manager create variables in google tag manager 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 variable 4 event model click on the new button from the user defined variables to add the variable in the next screen, enter the variable name as – event model 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 eventmodel in data layer version, select version 2 from the drop down and click on the save button 2 2 create tags in google tag manager create tags in google tag manager 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 docid\ yiaqs eva5ce5c 0zcuox 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 docid\ yiaqs eva5ce5c 0zcuox 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 the 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 view cart view cart view cart view cart now, the next 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 docid\ yiaqs eva5ce5c 0zcuox 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 docid\ yiaqs eva5ce5c 0zcuox 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 docid\ yiaqs eva5ce5c 0zcuox 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 now, let's start creating the tag for login event as per the below steps enter the tag title – login 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 docid\ yiaqs eva5ce5c 0zcuox in the tag id field under event name write – login now, click on the event parameters and then add 1 row by clicking on add row button add the parameter below parameter value eventmodel select variable event model 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 login under the trigger configuration , click the pencil like icon and then choose the trigger type as – custom event write event name as – login under ‘ this trigger fires on ’ select – all custom events click on the save your trigger screen should look like the below – now, let's start creating the tag for sign up event as per the below steps enter the tag title – sign up 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 docid\ yiaqs eva5ce5c 0zcuox in the tag id field under event name write – sign up now, click on the event parameters and then add 1 row by clicking on add row button add the parameter below parameter value eventmodel select variable event model 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 sign up under the trigger configuration , click the pencil like icon and then choose the trigger type as – custom event write event name as – sign up under ‘ this trigger fires on ’ select – all custom events click on the save your trigger screen should look like the below – now, let's start creating the tag for search event as per the below steps enter the tag title – search 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 docid\ yiaqs eva5ce5c 0zcuox in the tag id field under event name write – search now, click on the event parameters and then add 1 row by clicking on add row button add the parameter below parameter value eventmodel select variable event model 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 search under the trigger configuration , click the pencil like icon and then choose the trigger type as – custom event write event name as – search under ‘ this trigger fires on ’ select – all custom events click on the save your trigger screen should look like the below –