Google Tag Manager's timer trigger allows you to send events at timed intervals. Use this trigger to measure how long you spend on a page to complete a task, for example reading an article, filling out a form, or completing a purchase.
To create a new timer trigger:
- Click Triggers
New.
- Click Trigger Configuration and choose the Timer trigger type.
- The default value for "Event Name" is
gtm.timer.- This value specifies the name of the event as it's passed to Tag Manager. In most cases, you don't need to modify this value. You can optionally use this event name to create a custom event trigger. For example, specify an event name of “timer5”, then create another custom event trigger where the condition is "event equals timer5".
- Add an "Interval" in milliseconds.
- The trigger fires at the specified interval, for example every 5,000 milliseconds.
- Add a "Limit" value to specify the maximum number of times the trigger fires.
- Leave this field blank to let the trigger fire events until you leave the page.
- In the "Enable this trigger when all of these conditions are true" section, specify a variable, operator, and value.
- This step will ensure that the trigger listener is enabled only when necessary, to help improve overall website performance.
- Click Save and publish the container.