Enabling Google Analytics more than once can lead to inaccuracies in data collection. If you’re unsure if you’ve enabled Google Analytics before, follow these steps:
1. From your Shopify admin, go to Online store > Preferences.
2. In the Google Analytics section, make sure that the box is empty. If you see a code beginning with UA- instead, then you have Google Analytics enabled already.
3. In your Shopify admin, go to Themes > Actions > Edit code. Then, in the Layout section, click {/} theme.liquid. If you have any of these tags: ga.js, gtag.js, dc.js, or analytics.js, it means you have Google Analytics.
If you don’t have Google Analytics enabled, follow these steps:
1. From step 2, copy the Universal Analytics tracking code.
2. Open a new tab and log into your Shopify Admin account.
3. Navigate to Online store > Preferences.
4. In the Google Analytics section, paste your Universal Analytics property in the Google Analytics account field.