Add Google Analytics to Shopify

Contributors

@ali-al-difaie


Business Benefits

Track users on your website and use this data to optimize your website and marketing strategy.


Create a Universal Google Analytics property and get your tracking ID.

  1. Log in to your Google Analytics account.
  2. Click on Admin.
  3. Click on +Create property.
  4. Under Property name enter the name, for example, your website URL.
  5. Click on Show Advanced Options and select Create Universal Analytics property. Only Universal Analytics properties are compatible with Shopify.
  6. Enter your website URL.
  7. Click on Create a Universal Analytics property only toggle, to turn it on.
  8. Click on Next.
  9. Under Business information provide the requested information.
  10. Click Create.
  11. Note down the tracking ID. It’s available under Tracking ID and starts with UA- for example, UA-1891234047-1.

Add your tracking ID to your Shopify account.

  1. Log in to your Shopify account.
  2. Go to Your online store > Preferences
  3. In the Google Analytics section, add your tracking ID in the Google Analytics account field.

Turn on ecommerce tracking in Google Analytics to collect revenue and transaction data.

  1. Go to your Google Analytics account and click on Admin.
  2. Navigate to the View column and click Ecommerce Settings.
  3. Click the Enable Ecommerce toggle to turn it on.

Turn on enhanced ecommerce tracking in Google Analytics to collect advanced ecommerce data like product view to cart rate or product view to purchase rate.

In Google Analytics:

  1. Click on Admin.
  2. Navigate to the View column and click Ecommerce Settings.
  3. Click the Enable Enhanced Ecommerce Reporting toggle, to turn it on.

In Shopify:

  1. Go to Your online store > Preferences.
  2. Navigate to the Google Analytics section and tick the Use Enhanced Ecommerce checkbox.

Test that Google Analytics tracking is working.

  1. Go to your website.
  2. Open a separate window and tab, and log in to Google Analytics.
  3. Go to Realtime > Overview.
  4. If you see a number greater than 0 under Right now your tracking is working.