Set Up Google Tag Manager (GTM) without Shopify Plus

Problem

Recently, I set up a Shopify store to practice my marketing skills by running a few Facebook and Google ad campaigns. My plan for this store is that I will import a few products from Orberlo (a dropshipping plugin for Shopify), configure a quickly using one of the free themes that Shopify provides, and then start Facebook and Google campaign. Everything was fine until I tried to add Google Tag Manager (GTM) into my store. Turn out that you can edit the templates for all the pages but the “Checkout” page, at first I thought this is because of the security reason but then I found out that if you paid for the Shopify Plus plan then you will be able to edit that Checkout page. So this is just a trick to force you to pay for the full control of your store, I guess. So I dug around the dashboard to see if there’s any way that I can work around this limitation.

And I found something quite interesting, Shopify has a function that let you integrate Google Analytics (GA) into your store by letting you paste the GA code into the dashboard, and Shopify will take this code and inject itself into all the pages of your store including the Checkout page. The nice thing is that they have an additional option that lets you paste a javascript code that goes with this GA, some kind of extension. Wonderful, so basically you can run any script on any page!!!

Here the detailed step by step guide:

Step 1: Setup Google Analytics

  • Sign in to your Analytics account.
  • Click Admin.
  • Select an account from the menu in the ACCOUNT column.
  • Select a property from the menu in the PROPERTY column.
  • Under PROPERTY, click Tracking Info > Tracking Code. Your Google Analytics ID is displayed at the top of the page.
  • Go to your Shopify Store Admin > Online Store > Preferences
  • Paste the code above into the “Google Analytics account” box

Step 2: Inject the Google Tag Manager Script

  • Go to your GTM dashboard, it should be located here https://tagmanager.google.com/#/admin
  • Go to Admin > Install Google Tag Manager
  • Copy the code from the first box, exclude the `<script>` tag like below

Note: the reason we only need the first box is that the second box is only for browser without JS enable which is nearly impossible for the mainstream customer of your store, so you shouldn’t worry about missing that.

  • Go back to the GA setting in the Shopify dashboard above
  • Paste the code we just copied into “Additional Google Analytics JavaScript”

Congratulations, you have integrated successfully GTM into a non-Shopify Plus store.

To verify if the GTM tag you just integrate into your store is working, download the Google Tag Assistant at https://get.google.tagassistant