How To Add Google Analytics To Shopify

When you run a Shopify store, you’ll want to keep an eye on its performance. We do this through SEO and making changes that benefit your store’s online visibility so that you can get more traffic and more sales.

To know whether the changes you make are successful, you’ll want to check the analytics of your store from time to time.

Google Analytics is by far the most popular means of doing this. As the dominant search engine, an analysis tool built directly into the software is invaluable for those who conduct their business online. What’s even more useful is a full integration of Google Analytics with your Shopify store.

Fortunately, adding Google Analytics to your Shopify is easy. It can be summed up in several steps, which you can find below.

Before you begin, you need to first have a Google account, of course, and then sign up for analytics tracking with it. When you do that, you get to pick which metrics you want to track.

How To Add Google Analytics To Shopify

Enable Google Analytics Once

A common problem people face with Google Analytics is they accidentally activated it more than once. If this is your first time even considering Google Analytics, you can move to the next section.

If not, check that you haven’t enabled it twice. Having it enabled twice is going to give you inaccurate data that renders it useless and harms your Shopify store.

Need to check? Go to your Shopify admin and find the Online store section. In there, you’ll find Preferences. Under preferences, you should see there’s a Google Analytics section with a box.

The box should be empty but, if you have Google Analytics enabled, you’ll see code in that box starting with ‘UA-’. In that case, skip to the section on e-commerce tracking.

Otherwise, you should click Themes and then Actions and go to Edit code. There you’ll see a Layout section where you should click '{/} theme.liquid'. In that file, search for any of the following tags:

  • ga.js
  • dc.js
  • gtag.js
  • analytics.js

This also means that Google Analytics is active and so you don’t need to activate it again.

Make A Google Account

In case you’re unfamiliar with the process, you’ll also need to make a Google account. Chances are that you already have one of these accounts since they’re used for so much, in which case you can skip this section too.

If not, you’ll need one for Google Analytics. Go to and click the top right of your screen, where you should be prompted to register with them.

After going through a simple, streamlined process, you’ll have a Google account and Gmail set up. Don’t worry about using Gmail for much if you already have an email, it’s automatically tied to the account.

Enabling Google Analytics

Now that you’re prepared for Google Analytics, it’s time to enable it.

This is done by creating what is called a Universal Analytics property and adding it to the Shopify store. That’s the ‘UA-’ code in your Shopify admin that we mentioned above. Enable Google Analytics by following the below steps:

  1. Sign in to Google Analytics via your web browser.
  2. Click Admin and select your Account.
  3. Find Property and click Create Property.
  4. Enter any name for the property.
  5. Select Universal Analytics property only (there are four properties and only Universal Analytics is compatible with Shopify.)
  6. From there, click Next and make sure the settings are correct.
  7. Create and then copy the UA code.
  8. Find the Google Analytics section in your Shopify admin again (Online store – Preferences – Google Analytics)
  9. Paste the UA code into the Google Analytics box.

With that, you should have Google Analytics activated on your Shopify account. If it’s not working, make sure that there’s no password protection on the online store as this can interfere with Google Analytics’ visitor tracking process.

Enabling Ecommerce Tracking

There’s a specific e-commerce setting for Google Analytics that you should enable to get the best results. Depending on your store size and how dedicated you are to online SEO, you should choose between basic or enhanced ecommerce tracking.

Basic tracking gives you important details like transaction completions and revenue-based data. Enhanced tracking adds information about how visitors behave when they’re on-site.

Turning on basic e-commerce tracking is easy enough, just follow these three steps:

  1. In Google Analytics, select Admin.
  2. Find the View section and then E-commerce Settings.
  3. Select the Enable E-commerce option so that it’s on, not off.

For enhanced tracking, there are extra steps. Here they are:

  1. In Shopify admin, go to Online store and Preferences again.
  2. Under the Google Analytics section, select ‘Use Enhanced Ecommerce.’ You may be prompted to update Analytics to the latest version for this to work.
  3. Select Save.
  4. In Google Analytics, go to Admin.
  5. Find View and then E-commerce Settings.
  6. Select Enable Enhanced Ecommerce Reporting so that’s it’s on, not off.
  7. Select Save to keep these changes.

With that, you now have either basic or enhanced tracking on your Shopify store. Having analytics enabled is great for diagnosing your store’s performance and any problem areas that need to be dealt with.

By acting on any issues Analytics finds, you can maximize online traffic and your profit by doing so.

Google Analytics Advice

While compatible, there are some discrepancies between Google Analytics and Shopify that can confuse beginners. Let’s finish by going through some.

First, you shouldn’t need to worry about any discrepancies between the stats that Analytics and Shopify report to you. Using both is advised so that you have more well-rounded data to work from when working on the store.

The main discrepancy will be between the reported users that are visiting your site. Shopify consistently reports this figure as being less compared to Analytics, which can be attributed to differences in how each tool counts visitors.

Speaking of visitors, Shopify analytics can only accommodate 30,000 customers so you’ll need Google Analytics if you have a large store.