Creating a click listener or browser event based trigger

Triggers are a set of conditions that you can use to determine when Zaraz should or should not send events to third-party tools. In many cases, it is recommended to use the Zaraz Events API/dataLayer or the Zaraz Server-Side events to build triggers. This is true especially when you are tracking activities that happen only on your website. However, Zaraz can automatically capture events for the vast majority of user actions relevant to many websites. These include the following:

  • Pageviews - Zaraz automatically tracks whenever a page loads on your site (we support Single Page Application history changes as well).
  • Click Listeners - you can set up click-listeners, using CSS selectors, to automatically track whenever a user clicks a specific element on the page.
  • Form Submissions - you can track form submissions, using CSS selectors, trigger events whenever a user submits an online form. You can also choose to track only successful submissions.
  • Variable Match - you can set up triggers that use rules based on variables in the context of the browser.
  • Timer - you can set up triggers that use timers. Timers have an interval (how much time should pass before triggering?) and a limit (how many times should this trigger be repeated?). For example, you can set a timer-based trigger with a 1s interval, and the repeat limit to be 4. Accordingly, this trigger would be "fired" after a second has passed, and after the 2nd second has passed... until the fourth.

To set up triggers using the browser events, follow the instructions on Creating a Trigger. You can use the browser events section, at the bottom of the page, to configure your rules.