Sending Events Guide (technical)

This article is intended for developers implementing Appcues. See the  Events Overview for a higher level explanation.

Recommended events

See the Events Overview for recommendations.

Adding Events

If you haven't installed Appcues, adding Events is covered in the  Installation Guide (technical) and you should start there.

Otherwise, go to the installation page in Appcues to find the example code snippets based on your framework. Once there, select "I Want to Install Appcues Myself":

Choose the appropriate framework: 

Scroll down to the Events example:

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");

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.

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