Skip to content
weballin

weballin DIGIWIKI

Trigger

A trigger defines ‘when to execute a tag’ in GTM. Precisely control when tags are fired by combining event types (pageview, click, form submission) and filter conditions (specific URL, CSS class, data layer value). Accurately designing filters is the key to data accuracy.

weballin

A trigger determines when a GTM tag fires. A page view trigger fires a tag when every page loads, a click trigger fires a tag when a specific button is clicked, and a form submission trigger fires a tag when the form is successfully submitted. Setting trigger types and filter conditions well is the key to GTM quality.

A trigger combines an event type (e.g. click) and a filter condition (e.g. the CSS class of the clicked element is 'cta-button'). If you tag 'all clicks' without a filter, the tag will fire on all link/button clicks on the page, causing data contamination. Accurate filter design determines data accuracy.

GTM location: Manage all triggers in GTM (tagmanager.google.com) → Container → Trigger tab. You can see at a glance the type of each trigger, filter conditions, and number of connected tags. The four most frequently used triggers in weballin practice are page view, click (link/all elements), form submission, and custom event.

Key takeaways

  • The firing point is determined by a combination of event type (page view, click, scroll, form submission, etc.) and filter conditions.
  • You can restrict tag execution to only specific elements or URL patterns using regular expressions or CSS selectors.
  • Exception trigger (Blocking Trigger) blocks tags from firing under certain conditions.
  • Connect a dataLayer event to a tag with a custom event trigger.
  • One trigger can be shared with multiple tags, reducing duplicate settings.

References

Frequently asked questions

I set up a click trigger, but the tag fires even on buttons I don't want.

The click trigger does not have a filter condition or is set too broadly. When you click the desired button in preview mode, check the automatic event variables (Click Element, Click ID, Click Classes) and add a filter with the corresponding values. Example: Click CSS class equals 'cta-reservation'.

What should I do if the form submission trigger doesn't work?

GTM's form submission trigger detects the submit event of the HTML form tag. SPA forms created with React and Vue may not use native submit, so the trigger may not fire. In this case, the developer is asked to add dataLayer.push({event:'form_submit'}) when the form is completed and switch to using a custom event trigger.