Instructions
Google Tag Manager is a free tool that allows you manage and deploy marketing tags (snippets of code or tracking pixels) on your website (or mobile app) without having to modify the code. If planning on running Google Analytics through Google Tag Manager it is important you disconnect your existing Google Analytics account otherwise double counting will occur.
-
Shopify has a guide about how to add tag manager to their site https://help.shopify.com/en/manual/reports-and-analytics/google-analytics/google-tag-manager. We are only going to add the GTM snippets to the theme.liquid file.
-
Also contrary to the guide, we are going to have Google Analytics managed in Google Tag Manager so we will need to make sure any analytics account set up in the Shopify admin is cleared.
-
Next make sure that Google Tag Manager is set up for tracking Universal Analytics with Enhanced Ecommerce with the linker plugin enabled. The Auto Link Domains need to be set to match the urls configured separately in the Google Analytics Referral Exclusion List.
-
We won’t go into how to set up tags for tracking Google Analytics hits because the brand should be responsible for that.
-
Finally, set up a tag in Google Tag Manager for decorating forms upon submission. This adds a url param like _ga=2.8708022.243870959.1568637551-1925893344.1568393636 to the destination url of our redirects and is important for maintaining analytics session when crossing domains. Hyperlinks also need to be decorated but that should be handled automatically by the linker plugin in the Google Analytics Settings shown before.
-
Login to ShipEarly > Account Settings > Checkout Settings and add your GTM Container ID to the form and save. Please ensure regular Google Analytics is unchecked below.7. Confirm with Google Tag Assistant that all tags are firing on the appropriate pages.
Google Tag Manager Requirements
- Google Analytics with Enahanced Ecommerce: must be enabled
- Google Analytics Referral Exclusion List: must be setup: yourdomain.com, shipearlyapp.com, yourshopurl.myshopify.com
- Google Analytics / Google Ads Linking must be setup
Variables Setup
Triggers
Tags
Google Tag Manager Events & Steps
Our Google Tag Manager integration consists of two event types, Checkout and Transaction.
Checkout Event
The checkout event is anything from Customer Information Page load through to the customer hitting the payment submit button on the shipping method page.
Step 1: Loading customer information page https://shipearlyapp.com/shopify/customer_information
Step 2: Loading Shipping Method Page https://shipearlyapp.com/shopify/getShopifyRetailer
Step 3: Selecting Billing Address (May not always apply)
Step 4: Payment Submission
Transaction Event
The transaction event is what triggers the request of the sale to be placed into Google Analytics. Revenue is the total transaction amount less shipping, taxes, and discounts.
ecommerce: {
purchase: {
actionField: {
id: '1001',
affiliation: 'Brand Name',
revenue: '1000.00',
tax: '13.00',
shipping: '10.00',
coupon: '',
},
products: {
name: 'product name',
id: 'ecomm shop-url',
price: '1000.00',
category: 'product category name',
variant: 'color/size',
quantity: 1
}
}
}
}
}
Comments
0 comments
Article is closed for comments.