Google Tag Manager
Google Tag Manager is a tag management system created by Google to manage JavaScript and HTML tags used for tracking and analytics on websites (variants of e-marketing tags, sometimes referred to as tracking pixels or web beacons).
What is a tag?
A tag is a snippet of code that sends information to a third party, such as Google. If you don't use a tag management solution such as Tag Manager, you need to add these snippets of code directly to files on your website or mobile app. With Tag Manager, you no longer need to maintain each of these code snippets in your source files. Instead, you specify the tags that you want to fire, and when you want them to fire, from within the Tag Manager user interface.
How it works
Tag Manager for web works via its own container tag that you place on all your website pages. For mobile, Tag Manager is deployed in conjunction with the Firebase SDK, with support for Android and iOS. The container replaces all other manually-coded tags on your site or app, including tags from AdWords, Google Analytics, Floodlight, and 3rd party tags. Once the Tag Manager container tag has been added to your site or app, you update, add, and administer additional tags right from the Tag Manager web application.
For mobile containers, a default container is used to set initial tag configurations until the first time a container is downloaded. Once the app has connected to the internet and downloaded a container, it will never use the default container again. Applications periodically check for container updates, typically every 12 hours.
Your Tag Manager account allows you to administer the tags for one or more websites or mobile apps. Although you can set up multiple Tag Manager accounts from a single Google account, you’ll typically only need one Tag Manager account per company or organization.
What is the Data Layer?
To ensure maximum flexibility, portability, and ease of implementation, Google Tag Manager functions best when deployed alongside a data layer. A data layer is an object that contains any information you want to pass from your website to Google Tag Manager. You can pass information such as events or variables to Google Tag Manager via the data layer, and triggers can be set up in Google Tag Manager based on the values of those variables or specific events (for example, you can tell GTM to fire a remarketing tag when the purchase_total > $100). Variable values can also be passed through to other tags (e.g. pass purchase_total into the value field of a tag).
Rather than referencing variables, transaction information, page categories, and other important signals scattered throughout your page, Google Tag Manager is designed to easily reference information that you include in this data layer. Implementing the data layer with variables and associated values (as opposed to waiting for those variables to load throughout the page), ensures that they will be available as soon as you need them to fire tags.