To setup the 'Google Analytics Global Site Tag', please follow the steps below.
- If you have not already done so, create a Google Analytics property for each website you want to collect data from.
Creating a property generates a unique Tracking ID and a global site tag that includes the Tracking ID for that property. See the following section for information about finding your Tracking ID and global site tag.
2. Copy and paste the global site tag after the opening <head> tag on each page you want to measure.
Find your Tracking ID and global site tag
- Sign in to your Analytics account.
- Click Admin.
- Select an account from the menu in the ACCOUNT column.
- Select a property from the menu in the PROPERTY column.
- Under PROPERTY, click Tracking Info > Tracking Code.
Your Tracking ID is displayed at the top of the page.
Your global site tag is displayed farther down the page in a text box under Website Tracking > Global Site Tag (gtag.js)
The global site tag
The global site tag is several lines of code that you need to paste into each webpage you want to measure:
<!-- Global Site Tag (gtag.js) - Google Analytics -->
... (several lines of code) ...
</script>
To add the global site tag to your webpages:
- Copy the entire contents of the text box.
- Visit the following location in your store backend: > Store Settings > Cookies & Scripts > Standard Scripts
- Paste the code in the top text box labelled 'Non-intrusive (always added)'.
- Click 'Save Changes' at the bottom of the page.