On this page
In plain English
Websites use CSS selectors to style elements. GTM borrows the same patterns so a trigger can say "this exact button".
The most common ones:
#contact-formmatches the element with the IDcontact-form.btn-primarymatches elements with the classbtn-primarya[href^="tel:"]matches links whose address starts withtel:[data-track="hero-cta"]matches an element with that data attribute
To find an element's ID or class, right-click it in Chrome, choose Inspect and look at the highlighted HTML.
Example
In a click trigger, the condition Click Element matches CSS selector .pricing-card a tracks clicks on any link inside a pricing card. Clicks often land on an icon or text inside the link, so .pricing-card a, .pricing-card a * catches those too.
Official documentation
- CSS selector (opens in a new tab) MDN Web Docs
- About triggers (opens in a new tab) Tag Manager Help
Last reviewed