Setting up Google Analytics

Before you can start gathering data about your store, you need to have a Google account, sign up for analytics tracking, and choose what data you want to track.

Step 1: Make sure you don't have Google Analytics enabled already

Enabling Google Analytics more than once results in inaccurate data. If you're sure you've never enabled Google Analytics for your store before, then skip to Step 2: Get a Google Account. If you aren't sure whether you've enabled Google Analytics for your store before, then follow these steps:

  1. From your Shopify admin, go to Online store > Preferences.

  2. In the Google Analytics section, make sure that the box has only the text Paste your code from Google here, and is otherwise empty. If you see this, then continue to the next step. If you see a code beginning with UA- instead, then you have Google Analytics enabled already and can skip to Step 4: Turn on ecommerce tracking.

  3. Click Themes.

  4. Click Actions > Edit code.

  5. In the Layout section, click {/} theme.liquid.

  6. In the theme.liquid file, look for any of the following Google Analytics tracking tags: ga.js, dc.js, gtag.js, or analytics.js. If you see any of these tags in your theme.liquid file, then you have Google Analytics enabled already and can skip to Step 4: Turn on ecommerce tracking.

If you don't see a tracking code in the Google Analytics section of your Preferences page, and you don't have a Google Analytics tracking tag in your theme.liquid file, then Google Analytics isn't enabled on your store. Continue to Step 2: Get a Google Account.

Step 2: Create a Google Account

You need a Google account to use Google Analytics. If you already use Google products, such as Gmail or Ads, then you can use the same account for Google Analytics.

If you don't already have an account for a Google product, then create a Google account. You don't have to use the Gmail account for anything other than signing in and out of Google Analytics.

After you have a Google account, you need to Create an Analytics account. After you create your account, continue to Step 3: Enable Google Analytics.

Step 3: Enable Google Analytics

To enable Google Analytics, you must create a Universal Analytics property in Google and add it to your Shopify store.

Steps:

  1. In a web browser, sign in Google Analytics.

  2. Click Admin.

  3. In the Account column, select the correct account.

  4. In the Property column, click Create Property.

  5. Enter a name for the property.

  6. Select Create a Universal Analytics property only.

  1. Click Next.

  2. Select the appropriate settings.

  3. Click Create.

  4. Copy the Universal Analytics property to your clipboard by highlighting it and pressing ctrl+C on PC or command+C on Mac.

  5. In a new browser tab, open your Shopify admin.

  6. Go to Online store > Preferences.

  7. In the Google Analytics section, paste your Universal Analytics property in the Google Analytics account field.

After you enable Google Analytics on your store, continue to Step 4: Turn on ecommerce tracking.

Step 4: Turn on ecommerce tracking

You can implement Google's ecommerce tracking at two different degrees of detail:

Turn on basic ecommerce tracking

Steps:

  1. In your Google Analytics account, click Admin.
  2. In the View column, click Ecommerce Settings.
  3. Click the Enable Ecommerce toggle to turn it from OFF to ON.

If you need more detailed tracking information, then you can turn on Enhanced Ecommerce tracking.

Turn on enhanced ecommerce tracking

Steps:

  1. Open your Shopify admin.
  2. Go to Online store > Preferences.
  3. In the Google Analytics section, click the Use Enhanced Ecommerce checkbox. If you're using an older version of Google Analytics, then you might need to click Upgrade to the latest version before you can click the Use Enhanced Ecommerce checkbox.
  4. Click Save.
  5. In your Google Analytics account, click Admin.
  6. In the View column, click Ecommerce Settings.
  7. Click the Enable Enhanced Ecommerce Reporting toggle to turn it from OFF to ON.
  8. Click Save.

Ready to start selling with Shopify?

Try it free