Event Triggering
Learn how to show an Appcues Flow immediately after an event occurs in your app.
Table of Contents
This feature is available for Enterprise plans or as an add-on.
Event Triggering means displaying an Appcues flow when an event occurs. By default, users will be evaluated for displaying flows on page load. Event triggering will show that flow immediately after the event occurs, rather than requiring a page load.
If you'd like to learn the differences between Event Triggering and Event Targeting, check out our documentation: Pro Tip: Event Triggering vs Event Targeting
Intro to Event Triggering
How to set up Event Triggering
Sending the event to Appcues
In order for triggering to work, you start by sending an event into Appcues client-side. This can be done by sending events from your application (application events) or by creating Click-to-track Events (track events).  Â
If you're already doing one of these, skip to the next section.
Application events
On any occurrence of an event you want to track, add the following block, substituting event name and event attributes below with appropriate data (note event attributes are optional):
Appcues.track('event name', { event attributes (optional) });
After the first instance of the event is sent into Appcues, it will show up on the events and properties page in your account, in the settings area. You can read more about event tracking in the Sending Events developer documentation.
Click to Track events
In your application navigate to the page where you'd like to identify the event.  Click the Appcues Extension and select the Track Events option.  Select the event that you'd like to track, add a name, give it a quick test and you're good to go!  You can head over to the Click-to-track article for more detailed instructions if it's your first time setting up a Click-to-track event.
Set up the event trigger
From the Flow Settings page, find the section labeled "Trigger". Select the option for triggering on an event, and choose the name of the event from the drop-down menu.
Flow display
When the user performs the action that triggers the event, Appcues will receive the track call with the event name (in this example, Clicked Purchase Button) and trigger the appropriate flow to show immediately. 💯
How to use event triggering with nested attributes
In some cases, you may need multiple instances of the same event, but only want to take action or show a specific flow based on the attributes of that event. A good example of this might be tracking all Clicked Purchase Button events, but triggering a specific "Enterprise" flow when the plan purchased was labeled "Enterprise".
Here's how you might pass that event:
Appcues.track('Clicked Purchase Button', { planName: "Enterprise", buttonColor: "red" });
In the Trigger section of the Flow settings, here's how the event attributes section would look.
Note: you will need to type in the attribute name and value fields, no drop-down of previous data will be provided.
In the setup for attributes, you can use the normal operators, like 'equals', 'contains', 'does not contain', etc.
Event triggering and other targeting conditions
Event triggering plays well with other targeting conditions - so if you have an event set to trigger a flow, but only want it to happen on a specific page or pages, you can use the Page targeting section of the flow settings to limit it. You can also only show the flow to specific users, using the Audience section.
Using event triggering with Segment installs
For event triggering to work properly, the Segment installation must be done client-side (where the data gets sent from the webpage itself, as opposed to from a back-end server).
Event triggering and Segment works well in these circumstances:
- If you are using Segment to add the Appcues SDK to your webpage, and called Appcues.track("event!") for your events.
- If you have the Segment & Appcues integration enabled in your Segment account, and use Analytics.track("event!") for your events from the webpage itself (i.e. client-side).
Event triggering and Segment will not work in this circumstance:
- You send all events to your Segment instance server-side, using one of their server-side libraries.
To learn more about Segment client-side versus server-side installations, see their academy article on the subject. If you need further help, reach out to support@appcues.com for assistance.
Frequently asked questions
Can I target a flow to occur later based on these event attributes?  Â
You can use events themselves for targeting (see this doc), but the nested attributes are for event triggering only. We do not store nested attributes (there can be a lot of them!) so they can't be used for targeting later at this time.
Can an event-triggered flow show while other Appcues flows are being displayed?   Â
Event-triggered flows will take priority over any other flows set to show, even ones currently being displayed. Flows dismissed due to an Event-triggered flow will not show again (unless specifically set up to re-display in targeting conditions).
Can I trigger the same flow based on different events?  Â
Triggering a flow based on different events is not supported at this time. Use the clone feature to make a copy of the flow, and edit the Trigger section for each flow as needed.