This is your complete guide to transition your Non-Plus Shopify store to using our Google Tag Manager app by Elevar
Shopify Plus User? Use this guide instead.
Here are the required steps for the full implementation:
- Install Our Shopify App & Update GTM ID
- Remove Existing GTM Code
- Update Checkout Thank You Page Snippet
- Import GTM Container
- Implement Google Adwords/Remarketing gtag (optional)
- QA Website in Preview Mode
- Update Required GTM Variables
- Publish GTM Container & Monitor
Step 1: Install Our Shopify App & Update GTM ID
Once you install our app (it's a one-time $99 purchase. NO recurring fees!), you can move on to the installation instructions where you need to input your GTM container ID.
You will need to grab this ID from your GTM account, input into your Shopify settings, and click Save & Update:
Once you save then we have inserted three snippets into your theme:
- elevar-head.liquid (this inserts GTM container code)
- elevar-body-end (this creates the full dataLayer)
- elevar-checkout-end (this contains GTM and dataLayer for checkout pages, although this won't serve any purpose without access to checkout)
And then we've included these snippets in your:
That's it! You now have GTM installed on your website through the app.
Step 2: Remove Existing GTM Code
Chances are you already have GTM setup on your website. If you don't then you can skip this step :).
If you do, you likely have it:
- Implemented (hard coded) into your theme.liquid file
- Or implemented via your Google Analytics additional scripts setting
Either way, now that you've installed our app you will need to remove this to prevent duplicate GTM containers on your website.
I show in full detail how to look for this in this related help article
Step 3: Update Checkout Thank You Page Snippet
This next step requires you to copy the script in the app settings found here:
And once you've copied then you can paste into the checkout script settings below.
Please note: don't delete your existing scripts in here without checking first! It's possible you have scripts in here that are for other tracking purposes
Once you're done click save!
Step 4: Import GTM Container
Now it's time to connect your new dataLayer data from your store to Google Tag Manager!
Before importing our pre-built container, perform a backup of your existing live container.
Go to GTM > Admin > Export Container and click to export your workspace (most of the time this is the “Default Workspace”). Save this file just in case!
Now in order to connect your Shopify data to Google Tag Manager we need to create all of the variables, triggers, and tags for these to map to.
Next, you’ll need to import this container into your GTM account.
Go to GTM > Admin > Import Container then follow the steps below. DO NOT SELECT OVERWRITE!
- Select the container you just downloaded above
- Select your preferred workspace (most times this is "Default Workspace")
- Select Merge Container
- Review the detailed changes - if anything doesn’t look correct please email us.
Once you're confident everything is good then click Confirm and you will see the tags, triggers, and variables imported in your Workspace Changes:
Step 5: Implement Google Adwords/Remarketing gtag (optional)
These are the tags required for:
- Dynamic remarketing events sending product data into the AdWords retail events for dynamic remarketing like shown below:
- Global gtag.js script
- AdWords conversion tracking
There are two steps to complete this setup:
- Update the AdWords - Account ID Variable in the GTM Folder "UPDATE ON INSTALL". Please ensure your constant is something like AW-123456789 (no dashes inbetween the #'s)
- Update your AdWords Conversion Value and Labels for the transaction tag
Here is where you find your AdWords variable:
Go to Tools > Audience Manager:
Then go to AdWords Tag > Details:
Then copy your the variable shown here:
Then go to GTM > Variables > UPDATE - AdWords Account > copy your value here:
That's it for the remarketing setup!
To implement AdWords conversion tracking, then follow these next steps as well.
Here is the Adwords Transaction tag that needs your specific AdWords values updated:
And here is where you can find these in Google AdWords. Under "Conversions", either create a new transaction tag or go to your existing:
Here are the AdWords gtags that were imported into GTM for you:
Once you've unpaused each tag you are ready to move on!
If you previously had AdWords scripts or remarketing tags setup then you will need to remove these to prevent duplicate tags from firing.
Step 6: QA Website in Preview Mode
Now you'll need to set GTM into Preview mode and walk through all of your major pages of your website.
You will want to verify the data layer variables populate as shown in each section below.
Additionally, if you have enabled the AdWords Remarketing tags, click into each gtag tag (that's a mouthful!) to verify this data populates:
Homepage & Blog & CMS Pages
All of these pages should have these tags firing:
- AdWords - gtag - Misc Pages
And the dataLayer should contain:
Or if a customer is logged in you will see this additional data:
Collection & Search Pages
You will have the tags fire on pageview:
- AdWords - gtag - Collection and Search Pages
And the dataLayer should contain the same baseline data (visitor and page type) along with the additional collection page enhanced ecommerce data for impressions.
Note: this guide doesn't show how to put this impression data into use on your Shopify store for Enhanced eCommerce. This is only recommended for Shopify Plus stores so you don't lose out on checkout-only data that we aren't able to implement via GTM.
If everything is good then continue to do the same on your search result pages!
Note: Test all product page types if you have unique templates
On product pages you should see the following:
- AdWords gtag - Product Pages
And the dataLayer should contain the same baseline data (visitor and page type) along with the additional product page enhanced ecommerce data that can be used with Enhanced eCommerce or custom third party marketing tags:
If you send users to a shopping cart then you should see the following:
- AdWords gtag - Cart Page
And the dataLayer should contain the same baseline data (visitor and page type) along with the additional cart page enhanced ecommerce data for product list impressions.
Since we don't have access to your checkout pages then we can't insert GTM into these pages.
Checkout Thank You
This last page (the most important) you will want to see the following:
- AdWords - gtag - Thank you
Additionally if you click on the Data Layer tab in the GTM console, you will see all of the data available for your use in Google Analytics, marketing conversion tags, etc.
You'll notice some additional data like:
- Customer Order Count: total # of lifetime orders by the customer
- Customer Total Spent: total # of money paid in lifetime by customer
- Custom Email
- AdWords transaction tag
This data can be used in other third party tags (Snapchat, Bing, etc).
Step 7: Modify Elevar App Snippets (if required)
If any of your QA tests don't pass from Step 7, then it's likely that you have customizations to your theme that we aren't able to detect with our automated triggers.
Here are a few common examples:
1. Product SKUs are "undefined" in Product Tags
If this happens then it's possible that your product template name has been modified and requires a small config update.
We look for product.liquid so if you have alternative template names then you will need to add additional logic to account for these in the elevar-body-end.liquid file:
2. ecomm_value is undefined
If this happens on your product detail pages then you will need to adjust the two lines of code shown below. If you need help updating this for your store please chat us.
If you have other issues with testing please don't hesitate to chat us.
Step 9: Update Required GTM Variables
Each container you import into GTM will have a folder called "UPDATE ON INSTALL".
Variables found in this folder will be:
- AdWords account number (ex. AW-123-456-789)
Step 8: Publish GTM Container & Monitor
Once you are ready to go live it's time to publish!
Inside of Google Tag Manager, click the "Publish" button in the top right and confirm your deployment.
Once you've deployed then you can perform the same QA process in preview mode. Just be sure to click "Refresh" inside of GTM if you've made any changes: