**You must have a Google Tag Manager account and have it configured on Midori before proceeding**
Head over to Google Tag Manager.
Click on Variables in the left menu. There are Built-in variables and there are User-Defined Variables. We will add 4 variables:
* Google Analytics Settings
* Checkout step
* Revenue
* Sale ID
In order to add a variable, click on New
Google Analytics Settings
Name: Google Analytics Settings
Click on the Variable Configuration to open up a list of variables.
Scroll down the list and select Google Analytics Settings.
Click on Save.
Checkout step
Name: Checkout step
Select Data Layer Variable in the list of variable types.
Enter the Data Layer Variable Name ecommerce.checkout.actionField.step
Click on Save.
Revenue
Name: Revenue
Select Data Layer Variable in the list of variable types.
Enter the Data Layer Variable Name ecommerce.purchase.actionField.revenue
Click on Save.
Sale ID
Name: Sale ID
Select Data Layer Variable in the list of variable types.
Enter the Data Layer Variable Name ecommerce.purchase.actionField.id
Click on Save.
Tags
Head to Tags in the left menu and click on New for each of the tags below.
PageView
Name the tag Analytics – PageView then click on the icon to set it up.
Choose Google Analytics: Universal Analytics in the list of available types.
Fill the Tag Configuration form like below:
Then, click on the icon in the Triggering box to add a trigger, and select All Pages.
Click on Save.
AddToCart
Name the tag Analytics – AddToCart then click on the icon to set it up.
Choose Google Analytics: Universal Analytics in the list of available types.
Fill the Tag Configuration form like below:
Then, click on the icon in the Triggering box to add a trigger, and select AddToCart.
Click on Save.
RemoveFromCart
Name the tag Analytics – RemoveFromCart then click on the icon to set it up.
Choose Google Analytics: Universal Analytics in the list of available types.
Fill the Tag Configuration form like below:
Then, click on the icon in the Triggering box to add a trigger, and select RemoveFromCart.
Click on Save.
Checkout
Name the tag Analytics – Checkout then click on the icon to set it up.
Choose Google Analytics: Universal Analytics in the list of available types.
Fill the Tag Configuration form like below:
Then, click on the icon in the Triggering box to add a trigger, and select Checkout.
Click on Save.
Purchase
Name the tag Analytics – Purchase then click on the icon to set it up.
Choose Google Analytics: Universal Analytics in the list of available types.
Fill the Tag Configuration form like below:
Then, click on the icon in the Triggering box to add a trigger, and select Purchase.
Click on Save.
You are now done with your configuration for Google Analytics! Do not forget to publish your Container.