Event Triggering

This feature is available for Enterprise plans only.

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.

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. If you already do this, skip to the next section.

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.

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

Note: Event triggering with custom attributes is in Enterprise-only beta. Please contact us if you'd like to have it enabled. 

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 Display section of the flow targeting settings to limit it. You can also show it to 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 to 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.

Additional reading 📚