If you work in ecommerce, you’ve probably heard of Shopify. It is one of the world’s most popular pre-built shopping cart systems. Shopify is used by hundreds of thousands of websites. Google Analytics is directly integrated with Shopify. The setup is straightforward. However, when it comes to Google Tag Manager (GTM), it’s a different story. There is no direct integration for it.
Follow these steps to integrate Google Tag Manager with your Shopify store.
Creating the account
Sign up for Google Tag Manager Account and reach the stage where it will ask you to verify using code insertion
Pasting the Code
You will get two set of codes. Go to Online Store > Themes > Theme Editor > Theme.liquid file
Paste the first set of the code within <head> section (as shown in the image below)
Similary, paste the other set of code within body section. (as shown below)
The Checkout Section
Before leaving, you need to paste a copy of the complete code in the checkout page also.
For this, you can go to Settings > Checkout > Additional Scripts
Paste the complete set of code once again here.
Verify the Integration
Now, you can simply verify the integration, using Google Tag manager extension for Chrome Browser. A green signal indicates that the Google tag manager integration with Shopify store is correct.
In case you have taken higher plan in Shopify, then you will also get access to checkout.liquid file where you can repeat the same steps as we did in Theme.liquid.