Shopify Google Analytics Set Up

 

Step 1: Exclude IP of anyone who works at the store or on the site!
Step 2: Implement Google Analytics tracking pixel in Shopify
Step 3: Setup Google Analytics Enhanced Ecommerce In Shopify
Step 4: Create Content Groups
Step 5: Create Filters to Group Social Referral Traffic
Step 6: Track Search
Step 7: Track Demographics
Step 8:  Create Goals
Step 9:  Exclude Bots
Step 10: Track logged in users
Step 11: Identify organic search keywords

Best Practice:
Use One Property Per Domain
Use Universal Analytics
Have One Original View
For all Google Analytics changes it can take up to 24 hours for data to appear.
 

 
Step 1: Exclude IP of anyone who works at the store or on the site.

It distorts data. Google search “IP address” to discover your IP address. Inside your Google Analytics, go to “Admin”, and click “Filters”.

Create a new filter. Name the filter “Exclude My IP Address”. Select “Custom”, “Exclude”, “IP Address from the drop down, and type your IP address in the “Filter Pattern” field. Save it. Make sure this is not for the original view as you want that untouched.

Infratech Digital Marketing Agency Fee | Google Analytics

Step 2: Implement Google Analytics tracking pixel in Shopify

i. Login to Google Analytics then click “Admin” at the top and go to “Tracking Info” > “Tracking Code”:

Infratech Digital Marketing Agency Fee | Google Analytics 

ii. Copy your code that will look something like the below, but with your unique UA ID

Infratech Digital Marketing Agency Fee | Google Analytics

iii.Login to your Shopify store and go to “Online Store” > “Preferences”. You’ll see a Google Analytics section:

Infratech Digital Marketing Agency Fee | Google Analytics

Paste the Google tracking code you obtained from step 2 of this “Standard Google Analytics Setup” guide, into the “Google Analytics account” field in Shopify. Click “Save”.

Step 3: Setup Google Analytics Enhanced Ecommerce in Shopify

The enhanced eCommerce plug-in for analytics.js enables the measurement of user interactions with products on eCommerce websites across the user’s shopping experience, including; product impressions, product clicks, viewing product details, adding a product to a shopping cart, initiating the checkout process, transactions, and refund. https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

i. In Shopify go to “Online Store” > “Preferences”. Click the checkbox for “Use Enhanced eCommerce” then click “Save”:

Infratech Digital Marketing Agency Fee | Google Analytics

ii. Go to your Google Analytics account, click “Admin” then “Ecommerce Settings”:

Infratech Digital Marketing Agency Fee | Google Analytics

iii. Enable ecommerce and enable related products then click “Next step”:

Infratech Digital Marketing Agency Fee | Google Analytics

iv. Enable “Enhanced Ecommerce Reporting” then click “Done”:

Infratech Digital Marketing Agency Fee | Google Analytics

v. This last step ensures one analytics session happens across subdomains like a blog, your primary domain, and payment gateway. In the “Admin” section of analytics, click “Tracking Info” then “Referral Exclusion List”. Create new referral exclusions for:

  • Yourstore.com – The URL of your domain
  • paypal.com – The URL of any payment gateway. If you’re unsure of what this, you can wait a few days to see your referrals report for the source of transactions.
  • Checkout.shopify.com – This use to be in the checkout of stores
  • yourstore.myshopify.com – This is the domain of your Shopify admin to exclude referrals from the dashboard
Step 4: Create Content Groups

Content groups break your sites content down into collections, pages, blog, check and and homepage to help understand conversion rates, performance and user journey.

Login to your analytics then go to “Admin”. Click “Content Grouping” then “+ New Content Grouping”.

Go create up to five content groups now for the columns you created in step four. My standard recommendation uses “Group using extraction” with these regular expression rules suited for Shopify:

Infratech Digital Marketing Agency Fee | Google Analytics

  • Collections: ^/collections/(.*?)$

  • Products: ^.*/products/(.*?)$

  • Pages: ^/pages/(.*?)$

  • Blogs: ^/blogs/(.*?)$


Create Shopify’s ideal content groups report automatically using this report. Save it (it will be available under customisation > saved reports)

Step 5: Create Filters to Group Social Referral Traffic

Inside your Google Analytics, go to “Admin”, and click “Filters”.

Create a new filter. Name the filter “Combine Facebook Source URL”. Select “Custom”, “Search and Replace”, “Campaign Source”, and type the following as below:  ^.*facebook\.com$

Infratech Digital Marketing Agency Fee | Google Analytics

Create 2 new filters for Instagram and Pinterest as below:

Search String: ^.*pinterest\.com$
Replace string: pinterest

Search String: ^.*instagram\.com$
Replace string: instagram

Step 6: Track Search

Go to: Admin > View > View Setting > Scroll down to Site Search Setting

Infratech Digital Marketing Agency Fee | Google Analytics

  • Turn “Site Search Tracking” on
  • “q” is the GET variable for all Shopify sites - enter it in the box.
  • Check the “Strip query parameters out of URL” and leave Site Search Categories off.
  • It takes 24 hours for data to appear. You can view the data inside your Shopify analytics panel or in Google Analytics at “Behavior” > “Site Search”.
Step 7: Track Demographics 

i. Go to your Google Analytics account, click “Admin” then “Property Settings”.

Ii. Turn on “Enable Demographics and Interest Reports” then save.

iii. 3. The last step in analytics is in “Reporting” > “Audience” > “Demographics” > “Overview”. Click “Enable”.

See automated custom report for you to save here.

Infratech Digital Marketing Agency Fee | Google Analytics

Step 8: Create Goals

At the bare minimum, you should implement a Checkout Complete goal in only a few quick steps:

Go to: View > Goals > Goal setup, choose “Custom” > Goal description (Name it: Checkout Complete) > Choose type “Destination” > Click “Continue”.

Infratech Digital Marketing Agency Fee | Google Analytics

In ‘Goal details’ choose ‘Regular expressions’ (yes, that’s Regex again because the full URL is different for each visitor but it’s still following a pattern) > Enter the URL of the visitor’s final page visit after making a purchase (leave ‘case sensitive’ unchecked).

For your Shopify store it’s the following:

\/checkout\/thank_you

You can just copy this URL, even if you are not on Shopify Plus.

Turn on the ‘funnel’ switch > Add these steps (just copy them too as all Shopify stores have the same URL structure unless you do some customization):

Homepage: ^/$
Collections: ^/collections/([a-zA-Z0-9]|-|?page=[0-9])*$
Product page: .*/products/.*
Cart: /cart
Contact Information: /checkout/contact_information
Shipping Method: /checkout/shipping
Payment Method: /checkout/payment
Processing: /checkout/processing

Infratech Digital Marketing Agency Fee | Google Analytics

You can check if you entered the destination URL correctly by clicking “Verify this Goal”. If all is good, click “Save”.

You can view these as funnel graphs under "Conversions > Goals > Funnel Visualisation":

Infratech Digital Marketing Agency Fee | Google Analytics

And also  "Conversions > Goals > Goal Flow": 

Step 9: Exclude Bots 

Go to admin then “View Settings”. Click to check “Exclude all hits from known bots and spiders” then save:

Infratech Digital Marketing Agency Fee | Google Analytics

Step 10: Track Logged In Users

When someone abandons checkout on their mobile phone and completes their order on desktop, the mobile session should be acknowledged for its assistance to optimize sales. The User ID in Google Analytics unifies any number of sessions for a logged in user.

1. Go to admin, then “Tracking Code” for the property. Click on “User-ID”.

2. Read and comply with Google’s User ID privacy policy and your laws. Google has strict privacy policies in place for the feature to obey laws so follow them. Don’t be ignorant and get your ass bit. Respect people’s privacy and what you may not know about it. Go to the next step. 

3. Turn on “Session Unification”. If you have guest checkout in Shopify, this will bring a user’s session data into the User ID when it is created upon account registration. Go to the next step. 

4. Create the User ID View:

Infratech Digital Marketing Agency Fee | Google Analytics

5. You will be asked to setup a new view. Name it something like “www.yourstore.com – User ID View”. Select your time zone then create. 

6. Mimic the settings from your “Filtered View” covered throughout this guide into your “User ID View”. The primary things you want is the enhanced ecommerce tracking, view filters, and view settings. 

Google Analytics is ready to go. You just need to configure your Shopify. Login to Shopify and add this line of code in the “Additional Google Analytics Javascript” section (below where you added you GA UA tag):

if(__st["cid"]) ga('set', '&uid', __st["cid"]);

You can view the various cross-device reports under the “Audience” section of analytics.

Step 11: Identify Organic Search Keywords

See organic performance leveraging Google Webmaster Tools for Shopify, integrated in analytics.

1. Go to Google Webmaster Tools. Login or signup for an account.

2. Verify your store with Google Webmaster Tools by following Shopify’s documentation. I prefer to verify a store with a file upload to minimize code in the head of pages. You need to setup a redirect when using this method. Remove the query string from the end location of the redirect, which is the file you uploaded, in order for Google to verify. 

3. Go to Google Analytics. On the left-side, go to “Acquisition” > “Search Console”.

4. Follow the directions to enable Webmaster Tools in your analytics account.

Google may have up to 90 days of data on your store if you just setup Google Search Console. In the queries report, you will see all queries, their impressions, clicks, average position, and click-through rate. Here is a screenshot of an example sites organic performance from a Shopify business:

Infratech Digital Marketing Agency Fee | Google Analytics