How to setup google tag manager for your Shopify Store

Posted on

Let’s dive into setting up GTM on your Shopify store. Remember to check the bottom section where we’ll utilize data layers, GTM tags, and triggers to enhance your setup, enabling conversion tracking through Google Tag Manager.

Step 1: Acquire Your GTM Container Code First things first, let’s grab your GTM container code. If you haven’t got an account yet, follow this tutorial to create one. Then head over to your Google Tag Manager account. Click on your GTM ID at the top-right corner and copy the first part of the code.

Step 2: Theme File Editing in Shopify Navigate to your Shopify Store Admin > Online Store > Themes. Click on the three dots near your current live theme. As we’ll be editing your theme files, it’s wise to start by duplicating your theme as a backup. After duplicating, click the three dots > Edit Code.

Edit code Shopify

Step 3: Adding GTM Code into Shopify Theme Once you’re in the code editor, paste the GTM code you copied earlier into the theme.liquid layout. Note: If you’re using a Page Builder App that created new liquid files, you’ll need to add the GTM container code there as well.

Step 4: Incorporating GTM Code into Thank-You Page Unfortunately, Shopify doesn’t allow code addition to the Checkout page unless you have the Shopify Plus plan. However, we’ll add the code to the “purchase completed” section. Navigate to Shopify Admin > Settings > Checkout, and paste the GTM code into Additional Checkout Scripts.

Add checkout code to shopify

Step 5: Testing Shopify-GTM Setup via Preview Mode Verify your GTM – Shopify setup using Preview mode in GTM. If your GTM container is empty, publish the preview.

Step 6: Connecting Google Tag Assistant to Your Store Type in your store’s URL and click on Connect. If you receive the “Connected” notification, you’ve successfully installed Google Tag Manager.

Step 7: Final Validation After connecting Tag Assistant, visit different pages and hard refresh if changes aren’t immediate. Run a test order to ensure the GTM container triggers on the Purchase Completed page.

Congratulations, your GTM setup is complete!

Alpha Omega Digital  is a marketing agency based in Melbourne, Australia but also services clients from Sydney, Brisbane, Newcastle, Perth, Adelaide, Darwin and Hobart. Have a project in mind? Contact me here.

© Alpha Omega Digital, Melbourne Australia 2024 | All Rights Reserved