Event Tracking
Event tracking lets you create global trackable events and use them as conditions in your widget display rules. This allows you to show or hide widgets based on specific visitor actions.
---
Creating Events
To create an event:
- Go to your site Settings
- Open the Event Tracking tab
- Click the Add Goal button
There are three event types you can create.
---
Page Visit Event
Triggers when a visitor views a page matching a specific URL.
Configuration:
- Name — a label for this event
- Type — select "Page Visit"
- Matching condition — how the URL should be matched (exact, contains, starts with, etc.)
- URL — the page URL to match against
The goal is saved for any visitor who browses to a matching page.
---
Element Click Event
Triggers when a visitor clicks an element matching a CSS selector.
Configuration:
- Name — a label for this event
- Type — select "Element Click"
-
CSS selector — use a class (
.my-css-class) or an ID (#my-css-id) to target the element
The goal is saved when the visitor clicks the matching element.
---
Custom Events
Triggers when custom JavaScript code executes the event.
Configuration:
- Name — a label for this event (the JavaScript trigger name matches this event name)
Trigger code:
Popup.trigger('custom-event');
Replace custom-event with the name you gave the event.
How to Run Custom Events
There are three ways to fire a custom event:
A) When a widget appears
Add the trigger code in Display Rules > Tracking Pixel Code. The event fires each time the widget is displayed.
B) On button click
Add the trigger code in On Submit Actions > Execute JavaScript. The event fires when the visitor clicks the button.
C) Manually in your site code
Call Popup.trigger('custom-event'); directly from your own JavaScript.
---
Using Events in Display Rules
Once an event is created, you can use it to control widget visibility:
- Open your widget's Display Rules
- Under Show Only If, add a behavior-based condition
- Select "Trackable event"
- Pick the event you created
- Choose whether the widget should show when the event was or wasn't triggered
This lets you create sequenced experiences — for example, showing a follow-up widget only after a visitor has completed a specific action.
---
Need more help?
If you've worked through this and still need a hand, contact support — we'll dig in with you.