Track user activity on your website.
In Google Analytics, navigate to Admin > Property column > Tracking info > Tracking code and copy the tracking ID that starts with UA.
Use a descriptive name, so you will easily remember which GA account it belongs to.
Click on Tag Configuration, select Google Analytics: Universal Analytics from the Tag Type drop down, and select New Variable from the Google Analytics settings drop down.
- Leave Track Type set to default (Pageview).
- A new variable window will pop up. Name the variable and paste your Google Analytics tracking ID into the Tracking ID field. Set the variable name to GA - Settings - [your website name].
- Click Save and the variable will appear in the GA settings field of the tag.
Select All pages from the Triggering drop down and click on Save to set up the event that will trigger the tag to fire on every page.
In GTM, click on Submit in the top menu, give this version of your workspace a descriptive name, and click on Publish.
For example, if you added only the Page view tag, you could name this version Added page view tag for GA.
Test if GA is tracking the data on your page: open your website in incognito mode and navigate to a new page, then look at the Real time report in Google Analytics.
You should see the page view tracked. If activity on your website is tracked, then you have successfully set up GA on your page using GTM.