Add Google Analytics to Shopfiy
Using Google AnalyticsShopify
You will need
Check Google Analytics installation
- Go to your Shopify Admin, then Online Store, Preferences
- In the Google Analytics section, make sure that the field says "Paste your code from Google here". If there is no code in this field, proceed to the next step. If you see the code that starts with UA- instead, Google Analytics is already activated
Then, do the following:
- Go to Themes, then Actions > Edit Code
- In Layout click on
- Look for one of the following Google Analytics tracking tags in the
theme.liquidfile: ga.js, dc.js, gtag.js, or analytics.js
- If you see any of these tags in your theme.liquid file, you already have Google Analytics activated. You will need to remove existing code first before you proceed. See a discussion on this here
Sign up with Google Analytics
- You need a Google Analytics account. If you already have one, skip this step. To create an account, go to Google Analytics homepage and press "Sign up". If you already have a Google account, you can use it to sign in on this step
- The next screen gives you the option to choose between a website and a mobile app. Press "Website"
- Enter the Analytics account name, website name, site URL, select an industry category from the drop-down list, and scroll to the bottom of the page without changing the other checkboxes by default
Get a Google Analytics tracking ID
- When signing up for a Google Analytics account, press the “Get Tracking ID” button. A pop-up window will appear, showing the Google Analytics Terms of Service. Read and, if these terms work, press the "Agree" button. You will be redirected to your Google Analytics account.
- The first time you visit your Analytics account, you'll be taken to the tracking information section of the website. Here you can see the tracking IDs and scripts to use for website tracking
- To find you tracking script in your Google Analytics account, press Admin, then Property, Tracking info, Tracking code
- Copy the tracking code between the
Add Google Analytics script to a Shopify store
- Once you have a Google Analytics tracking code, sign into your Shopify account
- Open your Shopify Admin dashboard, then go to Online Store, Preferences
- Paste the Analytics tracking code in Google Analytics, Google Analytics account field
- Press Save. Done!
Set up Basic E-Commerce tracking in Google Analytics
Google's E-Commerce tracking can be implemented at two different degrees of detail.
- Basic E-Commerce tracking when only transaction and revenue data is needed
- Enhanced E-Commerce tracking, when additional information about visitor behavior is needed For Basic E-Commerce tracking:
- From Google Analytics Admin, in View, press E-Commerce Settings
- Press Enable E-Commerce switch to toggle it from Off to On
Enable enhanced E-Commerce Google Analytics tracking
To set up Enhanced E-Commerce tracking:
- On your Shopify Admin go to Online, then Preferences
- In the Google Analytics section, enable Use Enhanced E-Commerce option.
- If you are using an older version of Google Analytics, you may need to click Update to the Latest Version before checking the Use Enhanced E-Commerce checkbox
- Click Save. This allows Shopify to track all your website data and send it to Google Analytics.
- Now go to your Google Analytics Account, Admin, and in the View column
select Ecommerce Settings
- Press Enable Enhanced E-Commerce Reporting toggle to switch it from off to on. Then press Save
Google Analytics tracking in a Shopify store
E-Commerce events tracked in your Google Analytics account, with reporting. First data appears within 24-48 hours from setting up tracking.
↑ Press to view all guides for this result