{"id":155,"date":"2021-07-30T00:49:52","date_gmt":"2021-07-30T00:49:52","guid":{"rendered":"https:\/\/measurebit.com\/?p=155"},"modified":"2022-06-07T01:57:58","modified_gmt":"2022-06-07T01:57:58","slug":"5-steps-to-add-google-tag-manager-to-shopify-in-5-minutes","status":"publish","type":"post","link":"https:\/\/measurebit.com\/5-steps-to-add-google-tag-manager-to-shopify-in-5-minutes\/","title":{"rendered":"5-Steps to Add Google Tag Manager to Shopify"},"content":{"rendered":"
\n

In this article, I share 5-steps to add <\/span>Google <\/span><\/span>Tag Manager<\/span><\/span> to Shopify<\/span>. This should take 5-minutes or less to complete.<\/span><\/p>\n

(Note – In this article, I’m not covering how to set up marketing tags<\/span> for Universal Analytics<\/span>, Google <\/span>Analytics<\/span><\/span> 4, Google Ads, Facebook<\/span><\/span> Ads<\/span>, and other integrations. To keep this brief, I’ll cover these related topics in subsequent articles.)<\/span><\/p>\n

Why Use GTM on Shopify?<\/span><\/h2>\n

If you want to run profitable digital marketing campaigns for your Shopify store, you must track every meaningful step of your checkout process.<\/span><\/p>\n

This helps you understand the effectiveness of individual marketing campaigns… customer journey… customer lifetime value… ROI of your various products… content effectiveness… and so on. As a result, you can learn where exactly to focus your resources so you grow your business.<\/span><\/p>\n

Basic Shopify<\/i><\/span><\/span> comes with some analytic capabilities called <\/span>Shopify <\/i><\/span>Analytics<\/i><\/span><\/span>. This displays purchases, revenue, refunds, and even UTM data for referral traffic from other sites.<\/span><\/p>\n

Universal Analytics<\/span> is also a native Shopify integration<\/span> that includes <\/span>Enhanced <\/i><\/span>Ecommerce<\/i><\/span> Tracking<\/i><\/span>. <\/i><\/span>But Shopify only sends this conversion data to Universal Analytics<\/span> and not to Google Ads.<\/span><\/p>\n

Also, if you’re running Facebook<\/span><\/span> ads<\/span>, there are currently major issues with Facebook<\/span> Pixel and <\/span>Facebook<\/span> CAPI<\/span><\/a> not de-duplicating properly (hundreds of store owners complaining about this on Reddit)… so you end up double-counting conversions. This in turn screws up the reporting and profitability of your ad campaigns.<\/span><\/p>\n

Lastly, there’s <\/span>still no support<\/i><\/span> for Google <\/span>Analytics<\/span><\/span> 4 – Google’s much improved Google <\/span>Analytics<\/span><\/span> product.<\/span><\/p>\n

This means if you’re relying on Basic Shopify default features, you’re likely missing out on many profit-improvement insights.<\/span><\/p>\n

Google <\/span><\/span>Tag Manager<\/span><\/span> (or GTM for short) unlocks the full power of your conversion tracking<\/span> & analytics<\/span> power of your ecommerce data<\/span>. The only downside is, you normally have to upgrade to <\/span>Shopify Plus<\/span>, starting at $2,000 per month<\/span><\/a>. (Fine if you’re an enterprise customer but hard to justify for smaller stores.)<\/span><\/p>\n

The good news is, our solution doesn’t require <\/b>Shopify Plus<\/b><\/span>. <\/b><\/span>You don’t even need a Shopify <\/span>app<\/span> for this to work.<\/span><\/p>\n

So now we’ve covered the ‘why’ let’s go over how to set it up:<\/span><\/p>\n

5-Steps to Install <\/span>Google <\/span><\/span>Tag Manager<\/span><\/span> on Shopify<\/span><\/h2>\n

Step 2 – Get Your GTM <\/span>Code<\/span> Snippets<\/span><\/h3>\n

Once you accept Google’s terms (if this is your first time using Google <\/span><\/span>Tag Manager<\/span><\/span>), you’ll see the dashboard for your new web container.<\/span><\/p>\n

You will also see a popup containing two code<\/span> snippets… one for the <\/span><head><\/b><\/span> and the other for the <\/span><body><\/b><\/span>.<\/span><\/p>\n

Copy and paste these into a notepad. We’ll use them in just a moment.<\/span><\/p>\n

\"gtm<\/p>\n

Step 3 – Add GTM to Shopify Liquid Theme File<\/span><\/h3>\n

Now that you have your GTM head and body snippets, it’s time to add them to your Shopify store.<\/span><\/p>\n

To do so, log in to your Shopify account<\/span>.<\/span><\/p>\n

In the left-hand sidebar, click the “Online Store” link.<\/span><\/p>\n

\"Shopify<\/p>\n

Click the “Actions” button, and\u00a0choose “Edit” to open the Shopify theme editor.<\/p>\n

\"Shopify<\/p>\n

The <\/span>theme.liquid<\/i><\/span> file should open by default. If it doesn’t, click the link in the left side panel labeled “<\/span>theme.liquid<\/i><\/span>“.<\/span><\/p>\n

There are two places to paste the code<\/span> snippets you grabbed earlier. Note – you have a <head> snippet as well as a “body” snippet. Each one must be pasted in the right place.<\/span><\/p>\n

Paste the code<\/span> snippet<\/span> just after the opening <\/span><head><\/b><\/span> tag. This code<\/span> actually loads Google <\/span><\/span>Tag Manager<\/span><\/span>.<\/span><\/p>\n

\"GTM<\/p>\n

Now, scroll down until you see the opening <\/span><body><\/b><\/span> tag and paste the second code<\/span> snippet<\/span> (see the blue outline in the image below). This handles the scenario when a user’s browser doesn’t allow Javascript to run.<\/span><\/p>\n

\"Add<\/p>\n

Click the green “Save” button to update your Shopify theme<\/span>.<\/span><\/p>\n

Step 4 – How to Add <\/span>Google <\/span><\/span>Tag Manager<\/span><\/span> to <\/span>Shopify<\/span> Checkout<\/span>?<\/span><\/h3>\n

Now the GTM <\/span>container<\/span> code<\/span> will load on all of your main pages.<\/span><\/p>\n

At this point your setup is capable of tracking e-commerce events such as Page View<\/span>, View Item, Add To Cart and Checkout, but NOT Purchase completion… unless of course, you’ve upgraded to <\/span>Shopify Plus<\/i><\/span><\/span>.<\/span><\/p>\n

As a result, we have one more step in order to enable event tracking<\/span> for Purchase actions.<\/span><\/p>\n

This requires adding the GTM <\/span>code<\/span> snippet<\/span> to your “Checkout Settings”.<\/span><\/p>\n

Let’s go there now.<\/span><\/p>\n

First, click the “Settings” link at the bottom of the left-hand sidebar of your Shopify admin<\/span>.<\/span><\/p>\n

\"Shopify<\/p>\n

Click “Checkout”.<\/p>\n

\"Shopify<\/p>\n

Then scroll down until you see the section labeled “Additional Scripts”.<\/p>\n

Paste your <head><\/strong> code snippet in the box provided.<\/p>\n

\"Shopify<\/p>\n

Step 5 – Verify GTM Snippet is Installed Correctly<\/h3>\n

Finally, you need to check everything’s working correctly.<\/p>\n

In your Google Tag Manager container dashboard, click the “Preview” button in the top right-hand corner of the page.<\/p>\n

\"Google<\/p>\n

Enter the URL of your store in the Tag Assistant popup that appears.
\n\"Google<\/p>\n

Now, in the bottom right-hand corner of your screen, you should see an overlay box displaying the word “Connected”. This indicates the correct Google Tag Manager tag is found installed on your site.<\/p>\n

\"Tag<\/p>\n

Following these 5-steps, you should have your Google <\/span><\/span>Tag Manager<\/span><\/span> installation loading in your Shopify website<\/span> in just a few minutes.<\/span><\/p>\n

In future articles, I’ll go into detail on how to use Google Tag Assistant<\/span> to debug your setup. This is essential for getting all of your conversion tracking<\/span>, analytics<\/span>, and other integrations working correctly.<\/span><\/p>\n

Next Steps<\/span><\/h2>\n

Installing the GTM <\/span>code<\/span> on your Shopify pages <\/span>is just the beginning<\/i><\/span>. Next, you need to consider:<\/span><\/p>\n

Step 1- Create a Google <\/span><\/span>Tag Manager<\/span><\/span> Container<\/span><\/span><\/h3>\n

Head on over to <\/span>https:\/\/tagmanager.google.com\/<\/span><\/a> and click Create Account to create a new Google <\/span><\/span>Tag Manager<\/span><\/span> account<\/span> (if you don’t have one already).<\/span><\/p>\n

\"google<\/p>\n

Give your account an appropriate name. for example, your business name.<\/span><\/p>\n

Select your country.<\/span><\/p>\n

Name your container. I normally use the domain name of the store as a name.<\/span><\/p>\n

Then choose “Web” as the target platform.<\/span><\/p>\n

\"create<\/p>\n