Set up Google Analytics to track your website

Google Analytics is a free web analytic tool offered by Google which tracks visitor behaviors and demographics. This is a robust and powerful tool that provides indispensable information about your website and customers. 

In this article, we will help you integrate Google Analytics to track your pages through simple steps.

Create your Google Analytics account

Enabling Google Analytics more than once results in inaccurate data. If you are sure that you've enabled Google Analytics for your store before, please skip to "Set up eCommerce tracking with Google Analytics".
  • Step 1: Check if you have enabled Google Analytics already
    • Check if you insert Google Analytics codes in the Google Analytics section of Shopify admin. You can find this section in Shopify Admin -> Online Store -> Preferences -> Google Analytics box. If this section is empty, you haven't set it up yet.

    • Check in the code of your current Theme.
      • You can find it Shopify Admin -> Online Store -> Theme. Select Action on the current theme and click on Edit Code.
      • Then in the Layout section, navigate {/} theme.liquid. Go to Set up eCommerce tracking with Google Analytics if you find any of the following Google Analytics tracking tags as below:
        ga.js, dc.js, gtag.js,​ analytics.js

      • If you can't find any Google Analytics codes, you can move on to Step 2.

  • Step 2: Create a Google account
    • If you already using Google products such as Gmail or Ads, you can use the same account for Google Analytics. Otherwise, you can create a new account here.

  • Step 3: Create a Google Analytics account
    • Set up an account by clicking on Measurement starts

    • Enter your account name

    • Select which metrics you want to measure

    • Enter your website name, the website's URL (https// is recommended), your website’s industry category, and the time zone you want the reporting to be in. 

    • Once you did all that, accept the Terms and Services in order to get your tracking ID.

Connect your store with Google Analytics

  • From your Shopify admin, go to Online Store -> Preferences, then locate the Google Analytics account field to paste the tracking ID.

Set up eCommerce tracking with Google Analytics

  • To see e-commerce data in the report, you need to turn on eCommerce tracking. Google Analytics offers two types of eCommerce tracking:
    • Ecommerce tracking - Shows transaction and revenue data. Further instruction in Google Analytics here.
    • Enhanced Ecommerce - Provides a variety of insights into your visitors’ behavior. Further instruction in Google Analytics here.

E-commerce set-upPlease be well advised that for the Enhance e-commerce tracking, you also need to enable it in Shopify settings. You can do it in the Shopify Admin -> Online Store -> Preferences -> Google Analytics section.


To fire the event with the Cart button, it is required to add GA codes in your specific pages. You can learn more about it using Google's instruction right here. If you need help with setting up Google Analytics, feel free to contact our live chat or send us a ticket from the GemPages app. 

That's it! This is very straightforward. Connecting your store with Google Analytics will provide you insights in order to gather information about your customers.


If you're interested in learning more about powerful, user-friendly GemPages, please feel free to figure out more articles here or reach our Support Team. We'd be happy to answer any questions you have.

Was this helpful?