Skip to main content
Home Shopify Shopify Knowledge How to Add Google Analytics tracking code on Shopify

How to Add Google Analytics tracking code on Shopify

Sam|
November 1, 2024|
5 min read

Tracking your store’s performance is crucial for growth, and adding Google Analytics to Shopify helps you gain valuable insights into customer behavior. Without proper tracking, you might miss out on key data needed to optimize marketing efforts and drive sales. 

In this article, we will walk you through the steps of integrating Google Analytics tracking code into your online store to monitor your store’s performance effectively and make data-driven decisions to enhance your business.

Related posts:

What is Google Analytics Tracking code?

The Google Analytics Tracking Code is a snippet of JavaScript that you add to your website. This code collects data about your website visitors and sends it to Google Analytics, allowing you to analyze and understand user behavior on your site.

What is Google Analytics Tracking code?

Why should you add a Google Analytics tracking code to your Shopify store?

Adding a Google Analytics tracking code to your Shopify store is a game-changer. Here’s why:

  • Understand Customer Behavior: Gain insights into how visitors interact with your store, from which pages they visit to how long they stay.
  • Track Sales and Conversions: Measure your sales performance, conversion rates, and identify which products are the most popular.
  • Optimize Marketing Strategies: Analyze the effectiveness of your marketing campaigns and adjust your strategies to maximize ROI.
  • Identify Traffic Sources: Discover where your visitors are coming from—search engines, social media, direct traffic, etc.
  • Improve User Experience: Use data to make informed decisions on improving your website’s layout, design, and functionality.

In my view, adding Google Analytics to your Shopify store is crucial because it provides detailed insights into customer behavior, helping you make informed business decisions. It also allows you to track key metrics like sales performance and traffic sources, which is essential for improving marketing efforts and driving growth.

How to add a Google Analytics tracking code to your Shopify store?

Step 1: Create a Google Analytics 4 Property

If you don’t already have one, create a Google Analytics account. In your Google Analytics account, create a new “Google Analytics 4” property. This is the latest version of Google Analytics.

Then, you can click Settings -> Create -> Property.

 click Settings -> Create -> Property.

A new window will appear, filling in your store information.

A new window will appear, filling in your store information

Then, you need to describe your business. Once you finish, hit Next.

Then, you need to describe your business.

For the Business Objectives section, choose Drive Online Sales.

For the Business Objectives section, choose Drive Online Sales

On the next step, choose Web. A new window will show up.

On the next step, choose Web.

Enter your website URL and name, and turn on Enhanced Measurement. This function will allow you to measure interactions with your content by enabling options (events) in Google Analytics. No code changes are required when this function is available. Then, click Next.

Enter your website URL and name, and turn on

Finally, it should look like this.

Finally, it should look like this.

Step 2: Install the “Google & YouTube” app on Shopify

Go to the Shopify App Store, then search Google & YouTube, and install the app.

Install the "Google & YouTube" app on Shopify

Step 3: Setup GA4 in your store

Head back to your Shopify Dashboard, choose Google & Youtube, then click on Get Started.

back to your Shopify Dashboard, choose Google & Youtube, then click on Get Started.

Then select the property you just created, choose Connect. That’s it, you’ve successfully connected your Shopify Store to your GA4.

Then select the property you just created, choose Connect

Step 4: Implement the test by adding products to the cart

The best way to do this is to go to your website, navigate through your product catalog, add some items to your cart, and initiate the checkout process without actually completing it.

The best way to do this is to go to your website

Now, head over to your Google Analytics dashboard. Here, you should see some data show up. In case you don’t see the data, don’t worry since it could take up to 24 hours for your datastream to start collecting information.

head over to your Google Analytics dashboard

FAQs

What is the easiest way to add Google Analytics to Shopify?

The easiest way is to paste your Google Analytics tracking code directly into the “Google Analytics” section in Shopify’s Online Store Preferences.

How can I enable enhanced ecommerce tracking?

Enable it in Google Analytics under Ecommerce Settings and check the “Use Enhanced Ecommerce” box in Shopify’s preferences.

Why is my Google Analytics data not showing up in Shopify?

Make sure the tracking code is correctly placed and the property settings match the Shopify store’s configurations.

Can I use Google Analytics 4 with Shopify?

Yes, Shopify supports Google Analytics 4 (GA4). Just use the Measurement ID provided in GA4.

What should I do if I accidentally paste the tracking code twice?

Remove the duplicate code immediately to avoid sending double data to Google Analytics, which could result in inaccurate reporting.

Conclusion

To sum up, we have shown you a step-by-step guide to help you figure out how to add Google Analytics tracking code on Shopify. We hope that you can do it without any effort and empower your Shopify store.

Also, in order not to fall behind the competition, the analysis of what customers think about your brand is crucial to every business owner. Hence, you should check out our article: How to Connect Google Analytics to Shopify for more information.

Furthermore, should you have any questions, comments, or concerns; please do not hesitate to contact us. We are always ready to help you out in case you need anything.

Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.