Using Google Tag Manager with Shopify

Using Google Tag Manager (GTM) with Shopify is possible but, first we need to deal with the elephant in the room.

Shopify has its own built-in system for Analytics and eCommerce tracking so do not try to be clever and deploy this through GTM as this will result in cross-domain tracking not working properly.

Another issue to consider is, Google Ads Conversion tracking, if you are using the standard Shopify plan, you cannot use GTM reliably for conversion tracking due to not having access to the code file “checkout.liquid” this means that GTM can not be placed on the checkout funnel. If you use Shopify Plus then this gives you access to the “checkout.liquid” file and enables you to place the GTM code across every page of your website.

 

So Why Use Google Tag Manager With Shopify?

Here are the main reasons why you can and should use GTM with Shopify:

  • Setting up Events / Goals tracking for Analytics (not eCom related)
  • Google Ads Remarketing / *Conversion tracking (*if using Shopify Plus)
  • Any other 3rd party tags such as Hotjar

 

How To Set Up Google Tag Manager With Shopify

Follow these steps to integrate GTM with Shopify:

Log in to your Tag Manager and ensure you select the right account for your store. You will need to click on your Tag Manager ID to see the codes that will need to be placed on Shopify.

Tag Manager Code

Next copy the first code that will placed in the <head> section and log in to your Shopify Admin. Now you need to head to the Sales Channels and click Online Store. Then click the Actions button to a drop-down menu and select Edit Code.

Shopify Edit Code

You then need to select the “theme.liquid” file from the Layout Folder and place the Tag Manager code as high in the <head> section as possible.

Tag Manager Deploy In Shopify

Now you need to go back to Google Tag Manager and copy the 2nd part of the code which needs to be placed in the <body>  section. This needs to placed in the same “theme.liquid” file but you now scroll down until you reach the <body> section and paste the code here.

That’s it, all done you can now check to see if the installation was done correctly using the Tag Assistant extension by Google to see if it is correctly installed.

Are you look for a guide on how to setup Google Ads Conversion Tracking with Shopify? Head here