Google Analytics on Shopify

The most frequently asked questions about Google Analytics and Shopify get answered.

How do I add Google Analytics to Shopify?

There are a number of ways to add Google Analytics to Shopify depending on the version of Shopify you use.

The easiest way is to use Shopify’s built-in features for adding the Google Analytics tracking code. See here for a guide that shows you how to do it.

Shopify’s built-in features for Google Analytics are quite good and offer enhanced ecommerce features as well as display Google Analytics plugins. You will also have cross domain tracking configured with this functionality. Cross domain tracking is necessary because for all popular Shopify plans (https://www.shopify.com/pricing), the checkout and payment pages are located on the shopify.com domain, as opposed to the business’ own domain.

If you are an advanced Shopify user or work with a developer, you can also add some custom tracking codes to your site’s templates. However, be careful, as this can cause issues with the cross domain.

Shopify marketing teams that use Google Analytics often find that in their reports ecommerce transactions are attributed to checkout pages:

This may happen because of some issues with manually implemented codes in the templates. For example, if a JavaScript code is used to send users to checkout pages from the main domain, the session will end, the transaction will be attributed to the direct traffic source and a checkout page will be reported as the landing page for that particular session. (Here is a code snippet that has caused such an issue for one of my clients: onclick=”location.href = ‘/checkout’;”)

If you use Shopify Plus (https://www.shopify.com/plus), you are in advantageous position. You are able to add code to your checkout pages and use Google Tag Manager on your Shopify site (here is how to configure Google Tag Manager for Shopify Plus). In this case, you do not need cross-domain tracking because you have your checkout and payment pages on the same domain as all the other pages.

No matter which version of Shopify you use, you need to add some domains to the Referral Exclusion List in Google Analytics. See here.

Say Goodbye to Old Analytics Tools

Get a mind-blowing, personalized dashboard, automatically created.

Try it free