How to Add Google Analytics to Shopify

Brody Hall
By Brody Hall
Joel Taylor
Edited by Joel Taylor

Published November 29, 2021.

Shopify Logo displayed on a laptop

Google Analytics is one of the most powerful tools for understanding your Shopify store’s visitors, traffic, and engagement. It also offers Shopify users the ability to generate enhanced e-commerce reporting that will track and measure just about any metric you decide on. Best of all, it is free and relatively easy to use.

In this post, we’ll break down everything you need to know about how to install and connect Google Analytics to Shopify.

Does Shopify Support Google Analytics 4?

Yes, Shopify supports the latest version of Google Analytics, Google Analytics 4 (GA4). The best method is to have both GA4 (the newer version) and the previous version—Universal Analytics (UA)—installed. This is because, at this stage of development, GA4’s functionality is limited and UA can still fill in the gaps of tracking and analyzing site data.

Steps for Adding Google Analytics to Shopify

Currently, there isn’t an automated method of integrating GA4 into Shopify’s platform, meaning you’ll have to do it manually with some additional javascript coding by following these steps:

1. Start From the Google Analytics Dashboard

From the Google Analytics dashboard, go to “Admin” and select the “G4 Setup Assistant” from the right-hand column.

2. If Required, Create a New Property

Once the setup menu appears, create a new GA4 property by clicking the “Get Started” button. When the “Create a new Google Analytics 4 property” panel appears, click the “Create Property” button.

3. Copy the Required Code

Now, open your newly created GA4 property by clicking the “See your GA4 property” button. Next, get the code you’ll need to add to Shopify by clicking the “Tag installation” tab. Select the property and click the “Copy” button.

4. Insert the Google Analytics Code for Shopify

Now, from the Shopify dashboard, click on the “Themes” option from the dashboard menu. And lastly, make sure the {/}theme.liquid window is open (found under “Layout”) and paste the GA4 tag into your store’s code under the <head> command.

Is There a Google Analytics App for Shopify?

If manually setting up Google Analytics on Shopify sounds tiresome or simply beyond your technical skills, don’t worry. Thanks to a Google Analytics Shopify app called Google Analytics Toolkit, you can automate this process.

All you have to do is install the app and the Google Analytics Toolkit will do the rest for you. The best part: The app’s support team offers specific GA4 support and advice. So, if you ever get stuck, you can always reach out to them for help.

How to Check Installation

To double-check that GA4 has correctly integrated with your Shopify store, go into your Google Analytics settings and then your administrative settings. Verify that all the profile information is correct and fully functional. This includes double-checking to make sure your URL is correct and that the code is inserted correctly.

If this information is correct and errors remain, it could be because of a clash with other plugins or a problem with your theme. If your Analytics isn't tracking and you think it should, take another look at your settings.

Once installed correctly, you can access a detailed analysis and enhanced reporting anytime from the Google Analytics dashboard.