Google Analytics

Google Analytics lets you track visitors to your store, and generates reports that will help you with your marketing. For best results, use only the method described here to enable Google Analytics on your website.

Before you set up Google Analytics, follow the steps below to make sure Google Analytics isn't already enabled on your store. If you are sure that Google Analytics is not already set up for your store, then follow these instructions to get started.


There are a few reasons why you might see discrepancies between Google Analytics and Shopify Reports.

Before you begin

In general, you should only enable Google Analytics once, otherwise tracking will be inaccurate. Before setting up Google Analytics, make sure that it isn't already enabled on your site. If you are sure that Google Analytics isn't enabled for your store, and if you already have a Google account you want to use for analytics tracking, then you can skip ahead to set up Universal Analytics.

Before you begin setting up Google Analytics, you'll need to:

Make sure Google Analytics isn't already enabled

If Google Analytics is enabled already on your store, then your theme.liquid file will contain the following scripts:

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

If your file contains these scripts, then keep them only if you are upgrading from Classic Analytics to Universal Analytics, or if you have another specific technical reason.

To check for any potential problems with your site's tracking scripts, install Google's Tag Assistant. If Tag Assistant detects an issue, then you'll see an error message when you visit your site. For example:

  • Error: Detected both ga.js and dc.js scripts which will make tracking ambiguous.
  • Multiple Google Analytics tags detected.

Get a Google account

Before you can enable Google Analytics, you’ll need a Google account. If you already have a Gmail account, then you'll be able to use that. If not, create your Google account here. You don't have to use the Gmail account for anything other than signing in and out of Google Analytics.

Enabling Analytics

Shopify supports and recommends using Universal Analytics, which is the latest version of Google Analytics.

Grow your business

Want to increase traffic to your store? Try using Kit to run your ad campaigns for you.

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free