Skip to content
Home » Blog » How do I set up Google Analytics ecommerce tracking on Shopify?

How do I set up Google Analytics ecommerce tracking on Shopify?

To set up Google Analytics ecommerce tracking on Shopify, you can use the built-in integration or set it up manually using Google Tag Manager (GTM). Here are the steps for both methods:

  1. Using the Built-in Integration:
  • Login to your Shopify account and navigate to the “Settings” section in the left-hand menu.
  • Click on “Online Store” and then “Preferences”.
  • Scroll down to the “Google Analytics” section and enter your GA4 measurement ID in the “Google Analytics” field.
  • Enable the “Use Enhanced Ecommerce” toggle and click “Save”.
  1. Using Google Tag Manager:
  • Sign in to your Google Tag Manager account and create a new tag.
  • Select “Custom HTML” as the tag type.
  • Paste the following code into the “HTML” field, replacing “GA_MEASUREMENT_ID” with your GA4 measurement ID:
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'GA_MEASUREMENT_ID');
  • Set the trigger for the tag to “All Pages”.
  • Save the tag and then create a new trigger.
  • Select “Custom Event” as the trigger type.
  • Enter “gtm.dom” as the event name.
  • Save the trigger and then publish the changes.

Once you have set up ecommerce tracking using either of these methods, Shopify will automatically send ecommerce data to your GA4 property, including transaction and product data. You can then use GA4 to analyze this data and gain insights into your ecommerce performance.