Setting up Google Tag Manager on Your Shopify Store

by ShahzadaAliHassan - 27th October 2023

Introduction

In this blog, we'll dive deep into how you can configure Google Tag Manager (GTM) on your Shopify store. This detailed guide will provide you with step-by-step instructions, ensuring a seamless setup process.

Google Tag Manager allows us to manage and deploy marketing tags on our website without modifying the code. This is especially useful for those who aren’t developers.

Prerequisites:

If you're all set, let's dive in!

Setting Up Your GTM Account

For those who already have a GTM account:

  1. Log in to your account. You will see your existing containers. But if you're new, you won't see any.
  2. Click on Create Account on the top right.
  3. Enter the name of your company or business.
  4. Under the container, set up the URL of your website.

TipIt's best to use one GTM container per business. If you have multiple domains for the same business, use one container.

Integrating GTM on Shopify

Now, we need to place the GTM code snippets on your Shopify store. Don't worry; it's just copying and pasting.

  1. Head to Google Tag Manager > Settings > Install Google Tag Manager. You'll find two snippets:
  • One for the head section of your site.
  • One for the body section.
  1. Copy the head snippet.
  2. Go to your Shopify dashboard > Online Store > Themes > Click the three dots (…) > Edit Code.
  3. Navigate to the theme section, and right under the <head>, paste the code you copied.
  4. Now, go back to GTM and copy the body snippet.
  5. In Shopify's code editor, find the <body> tag. You can use Ctrl + F or Command + F to search.
  6. Paste the body code snippet right after the opening <body> tag.

NoteIt's a good practice to make a duplicate (backup) of your theme before editing its code. This ensures you have a fallback in case of any mistakes.

Conclusion

With these steps, Google Tag Manager should now be correctly set up on your Shopify store. You can now easily track events, understand your audience better, and improve your marketing strategies.

Remember, if you're ever in doubt, there's always a community willing to help out. Join forums, ask questions, and always keep learning.


Happy tagging!