In order to properly configure Google Analytics via Google Tag Manager, you need to complete the following steps:
Set up the Google Analytics UA variable in GTM variables;
Create the GA tag "Page views" in the GTM tags;
Configure the trigger associated with the tag;
Publish the new version of the container.
To create the UA variable, you must first retrieve the tracking ID from your Google Analytics account (we assume your account is already created, let us know if you have any problems with this)
In the Google Analytics admin, go to Property > Tracking code, then copy the tracking ID displayed at the top of the page. In my case, my tracking ID is: UA-185794038-1.
Then go to the Variables tab in Google Tag Manager.
Click on "New" under "User-Defined Variables".
Choose "Google Analytics Settings”.
Paste your GA tracking ID into the Tracking ID field of the variable, and rename your variable. In my case, I named it GA - UA ID
Finally, save!