Event Targeting

Similar to how you can target flows based on user properties, Appcues allows you to target flows to your users based on events they have or have not experienced in your own platform.

Event targeting (and tracking events in general) requires some light JavaScript coding, so have an engineer handy when you want to set event tracking up the first time.
If you've installed Appcues through Segment (and are capturing events through there), events will be sent to Appcues via your Segment installation.

Overview

Unlike user profile attributes, which may change with time, event data is an unchanging record of what happened (the event name and attributes), when (timestamp), and to whom (user ID). Events may be added, but not removed or altered.

In your app, there will be events that you may want to keep track of in order to help you understand your users' behavior more clearly.

A few typical examples might be "Clicked call-to-action button" or "Added item to shopping cart". Some events may originate outside your web application, for instance a newsletter email may send events for "Email viewed" or "Unsubscribed".

These events are usually sent to one or more analytics services, for further inspection later.

The Appcues event targeting feature allows you to use these events to tailor your messaging to specific classes of users based on their experiences through your product, end-to-end.

How to track events

If you're using Appcues through our Segment integration, use the analytics.track() function to track events. The events you track will then be available to Appcues and the other services you've integrated with.

If you are using Appcues outside of Segment, you can use the Appcues.track() function, which works just like analytics.track() but only sends events to the Appcues API.

The examples below will use Appcues.track().

Tracking an example event

Let's consider an auction site that wishes to show a message of congratulations after a user creates their first auction.

The site developer may add a line of code to their application that looks like this:

Appcues.track("Created auction");

Or, to keep track of additional attributes of the event:

Appcues.track("Created auction", {
  section: "Home and Garden",
  length: "7 day"
});

The time at which the event occurred, as well as information about the user who experienced the event, is automatically recorded, so don't worry about putting this in yourself.

Targeting Appcues content by event history

Then, after creating a modal or slideout window of congratulations, the site owner can go to the Settings screen and select "Choose who sees this based on events they've experienced":

And select the "Created auction" event from the dropdown menu:

In this case, the site owner only wants to show this message after the user's first auction, so under "Choose how many times users see this", they can select "Show once":

Finally, once the site owner hits Publish on the new content they've created, their congratulations message is live!

Tips

Ensure Appcues.identify() or Appcues.anonymous() (or the analytics.js equivalent) has been called before tracking events.

A user ID, whether identified or anonymous, is required to record event data, so make sure any calls to track() come after a call to identify() or anonymous().

Don't put too much detail into event names.

You want to be able to group similar events by name, so rather than:

Appcues.track("Added item ID=12345 to shopping cart");

Do this:

Appcues.track("Added item to shopping cart", {item_id: 12345});

Targeting based on event attribute values may be added in a future version of Appcues. Event attributes are also useful for examining data on dedicated analytics platforms like Amplitude or Mixpanel.

Still need help? Contact Us Contact Us