Install Google Analytics via Google Tag Manager
You should always start with a measurement plan that details the data you want to collect. This will help you report the performance of your business objectives and key performance indicators (KPIs) to your stakeholders. If you’re new to measurement planning, check out Analytics Academy for tips on how to create a solid measurement plan.
Once you've defined a measurement plan, you'll need to create a container and place the GTM container code on your website.
Then, you can install a basic implementation of Google Analytics via Tag Manager in four steps:
- In Google Tag Manager, select ‘Create Tag’ and then choose the Google Analytics tag template.
- Select ‘Universal Analytics’.
- Configure your tag by naming it (it will default to the tag template name if you do not choose to change it). We suggest naming it "GA Pageview." Then add your Google Analytics property ID or your gaProperty variable. Finally, choose the Track Type, which in this case, should be the most common type of tracking: ‘Page View.’ A pageview tracks each time a browser loads a site page. Other types of tracking include Events, Cross-domain, Social, and Transaction and refer to the type of action you want to track on your website.
- Choose your firing triggers. For a basic Google Analytics implementation, select ‘All Pages’. This means that the Google Analytics tag will fire, or execute, on every page of your site.
We also recommend enabling Display Advertising Features via the checkbox on step 3. This is an important feature for using display advertising remarketing features, showing demographic data in your analytics reports, and for enabling the ability to perform segmentation based on demographic data.
You’ll notice that there is an option to configure other Google Analytics features in the “More Settings” and “Advanced Settings” section. We’ll cover these areas later.
Choose Create Tag. Now you are ready to preview, debug, and publish this tag.
This one simple tag enables you to receive Google Analytics data. Without doing much else, you will receive data such as the number of users visiting your site, the pages that they viewed, their time on site, bounce rate, incoming traffic sources, goal conversions, and much more.