Tags fire in response to events. In Google Tag Manager, a trigger listens to your web page or mobile app for certain types of events like form submissions, button clicks, or page views. The trigger tells the tag to fire when the specified event is detected. Every tag must have at least one trigger in order to fire.
Triggers are evaluated when code on the page or app is executed, and associated tags are fired or blocked when the trigger conditions are met.
Create a new trigger
To create a new trigger:
- Click Tags New.
- Click Trigger Configuration.
- Select the trigger type you would like to create.
- Complete the setup for the selected trigger type.
Create a trigger from a tag definition
You can create a new trigger during tag configuration. From any tag configuration page:
- Click Triggering.
- Click Add.
- Click Trigger Configuration.
- Select the trigger type you would like to create.
- Complete the setup for the selected trigger type.
Edit a trigger
To edit an existing trigger:
- Click Triggers.
- Click the name of the trigger you want to edit.
- Click Trigger Configuration to edit the trigger.
- Click more actions to copy, delete, view changes, or show notes for the selected trigger.
Trigger filters
New triggers default to fire on all events for the associated event type. You can further specify when a trigger fires with trigger filters. To enable a filter, look for "This trigger fires on" at the bottom of a trigger configuration page, and select "Some <event>", where <event> is the type of event you'd like to work with.
Each filter is made up of a Variable, an Operator, and a Value:
Variable (menu) | Operator (menu) | Value (text field) |
---|---|---|
Select the appropriate existing Tag Manager variable, add a new built-in variable, or create a new variable from this menu. | Choose an operator from the menu, e.g. equals, contains, less than, matches RegEx, etc. | Tag Manager compares the value you provide with the value in the variable at runtime. Enter an appropriate text value. |
For example, a tag with a trigger based on a pageview event with the following filter may be used to fire a tag on a website where /products/ is a predictable part of the URL on all product pages: