Use Google Tag Manager's click trigger to fire tags based on click events. When an element is clicked on a page that matches the trigger conditions, Tag Manager will automatically populate values for any active click-based built-in variables.
To configure a click trigger:
- Click Triggers New.
- Click Trigger Configuration and choose a click trigger type:
- All Elements: Track clicks on any element on a page, e.g. links, images, buttons, etc.
- Just Links: Track clicks only on HTML links that use the
<a>
element, e.g.<a href="google.com">Google.com</a>
.
- Optional for "Just Links" triggers:
- Wait for Tags: Select this option to wait until all tags have fired, or the specified timeout has elapsed.
- Check Validation: Only fire tags when the link click is considered a valid action. If unselected, the trigger will fire tags whenever a link is clicked.
- Optional, but recommended for improved performance: Specify conditions (usually a URL pattern) for pages where you expect a click to occur:
- Under the heading "This trigger fires on", select "Some Clicks".
- Under "Fire this trigger when an Event occurs and all of these conditions are true", add a filter to enable this trigger only on pages that require it, e.g. Click URL contains /path/to/promo.