Show your popup the moment your site fires an event you name: a login, a filter change, a checkout step.
What it is
The standard triggers watch what a visitor does on the page: how long they stay, how far they scroll, whether they're about to leave. But some moments only your own site knows about. A customer logs in, applies a filter, adds a gift card, or reaches a step in a custom checkout.
The JavaScript event trigger covers those moments. You give the event a name in the campaign's settings. When your site fires a DOM event with that exact name, on the document or on the html element, the popup appears.
It takes one line of code on your side, usually added by your developer: document.dispatchEvent(new Event('user_login', { bubbles: true })). From then on, the campaign reacts to that moment like it would to any other trigger.
Use it when none of the other five triggers fits. If the moment can be described as a delay, scrolling, exit intent, a click or inactivity, one of those is simpler and needs no code.
When to use it
Fire user_login when someone signs in, and greet them with a members-only offer or a nudge to finish their profile.
Fire an event when a filter is applied, and offer help choosing, or a discount on the category they're looking at.
A one-page checkout doesn't load new pages, so URL rules can't see its steps. Fire an event at the step that matters, like choosing delivery.
A size finder, a configurator or a quiz you built yourself can fire an event when it finishes, and the popup takes it from there.
Key benefits
If your code can tell something happened, your popup can react to it. You're not limited to what the standard triggers can see.
Add up to 20 event names. Any one of them opens the popup, so one campaign can cover a login and a sign-up alike.
Each event name has its own Desktop / Mobile switch, so one event can open the popup everywhere and another only on desktop.
How it works
On the campaign's Settings tab, under When will the popup show up, click Add trigger and pick On a JavaScript event. Enter an Event name, for example user_login, and choose the devices.
Add one line where the moment happens: document.dispatchEvent(new Event('user_login', { bubbles: true })). The name has to match exactly.
Click Save, then Save changes. Then do the action on your site and check that the popup appears.
Settings & limits
OptiMonk listens for it, but the event comes from your own code. Without that line, the trigger never fires.
An event name can't contain spaces. You can add up to 20 names to one trigger.
Ask for this trigger in chat and the assistant sets it up, but only with an event name you give it. It never makes one up.
It combines with the campaign's other triggers with OR. Frequency limits and targeting rules still apply on top.
Step-by-step setup lives in the Help Center guide.
When the moment isn't covered by the other triggers: a login, a filter change, a step in your own checkout.
From your own code, with the exact name you entered: document.dispatchEvent(new Event('your_event', { bubbles: true })). Fire it on the document or on the html element.
Yes. Click Add another event to add more names. Any one of them opens the popup.
Yes. Each event name has its own Desktop / Mobile switch.
No. Use something like user_login or filter_applied instead.
No. The assistant sets up the trigger only with an event name you give it.
Usually, yes. Someone has to add the line that fires the event to your site's code.