Tags and analytics
To track visitor behavior or run marketing experiments on your website, you need tags. This page explains what tags are and how they connect to tools like Google Analytics and Google Tag Manager, so the setup guide makes sense before you start it.
A tag is a small piece of code that collects information about what happens on your website and sends it to another service, such as:
- Google Analytics (page views, events)
- Google Ads (conversion tracking)
- Facebook (audience building)
In short, tags help you measure and understand user behavior.
Google Tag Manager
Section titled “Google Tag Manager”Google Tag Manager (GTM) is a free tool for adding and managing tags without editing your website’s code directly. Instead of placing each tag individually on your website, you:
- Install and configure the Google Tag module, which places one GTM container snippet on your site. Drupal CMS does this for you when you install the Google Analytics recommended add-on with your GTM Container ID.
- Use the GTM website to create and manage tags. When you publish changes there, they automatically apply to your Drupal CMS site.
With GTM, marketers and editors can add new tags or update existing ones without needing a developer or administrator to update the website.
Containers
Section titled “Containers”A container in Google Tag Manager is like a workspace: it holds all the tags, triggers, and variables for one website or app. Each container has a Container ID (for example GTM-XXXXXXX) that connects your site to Google Tag Manager. If you use Tag Manager, have the Container ID handy when you install the Google Analytics add-on.
Google Analytics
Section titled “Google Analytics”Google Analytics is one of the most common tags you will use. It helps you:
- Understand visitor behavior
- See which pages and content perform best
- Monitor marketing campaigns
Google Analytics reaches your site in one of two ways. The add-on can load it directly from its Measurement ID (G-XXXXXXXXXX), which is all a site that only needs analytics requires. Or it can be a tag inside Google Tag Manager, so you change its configuration (for example, adding new events or adjusting tracking settings) in GTM, and the changes apply on your site.
How Drupal CMS connects them
Section titled “How Drupal CMS connects them”Drupal CMS installs the Google Tag module when you install the Google Analytics recommended add-on, which keeps the workflow short:
- You enter one Google tag ID when you install the add-on: a Google Analytics Measurement ID or a GTM Container ID.
- Drupal CMS adds the tag code to every page.
- With a GTM Container ID, you manage your tags, including Google Analytics, directly in Google Tag Manager.
The GTM path gives marketers, editors, and site owners the flexibility to update and experiment with tracking and marketing tags without a developer editing site code.
Where to go next
Section titled “Where to go next”- Set up Google Analytics walks the full setup, from creating the accounts to verifying tags fire.
- Submit your site to search engines covers the checklist items that depend on these accounts.
- Add features with recommended add-ons explains how add-ons like Google Analytics install.
Was this page helpful?
Drupal is a registered trademark of Dries Buytaert.