A trigger is a specific circumstance on your site, or an action a user takes, which causes your tag to activate. Without a trigger, your tags will not fire. To add a trigger:
- Open the container you created.
- In the Triggers tab, hit Add Trigger.
- Give your trigger a name
- Choose the trigger type from the following options:
- Page load: when the user visits your website (most common, this is used for most analytics, ads and tracking tags).
- DOM Ready: trigger the tag after the page has loaded (use if your tag interacts with page elements which need to be loaded first).
- All clicks: Any time a user clicks something on your page.
- Specific click: When a user clicks a specific page element such as a button. Specified using the element’s CSS class.
- Scroll depth: The percentage of the page a user scrolls. Useful for measuring interaction.
- Custom Event: Any custom event you configure.
- Timer: How long (in ms) the user stays on the page.
- History Change: When a user clicks their browser’s Back or Forwards buttons.
- Form submit: When the user clicks the submit button on a form (e.g. a contact form or a shop checkout). Specified using the form’s CSS class, or leave blank for all forms.
- If you want to narrow the scope of your trigger (for example, only allow it to fire on a specific page), add a Condition.
- Click Create Trigger.