5 Google Tag Manager Concepts

In Chapter 4, “Account Creation and Tracking Code Installation,” we created a new Google Analytics (GA) account and a new GA property within the account. We then copied the provided tracking code into our website template so each page would execute ga('send','pageView') on each page load and thereby populate our GA property.

We’re now going to look at a different way to get data into GA: through a GA tag within Google Tag Manager (GTM). Note that Google Tag Manager does not replace Google Analytics: we’re still going to need to create a GA account and property and still send a pageview hit to GA each time a page loads.

When we use GTM, however, we do not add the native code to our pages. Instead, we start with container code. It is through the container that we will add and modify GA. We’ll also be able to use the container to add other types of marketing and analytics tags to our website.

Google Tag Manager Concepts

Google Tag Manager is Google’s free ...

Get Google Analytics Breakthrough now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.