Mobile: Sending Mobile Events Guide (technical)

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


Strengthen your audience segments by tracking your users's behaviors and actions.

Recommended events

See the  Events Overview for recommendations.


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

Adding Events

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

1. First import the Appcues module.


import Appcues


@import Appcues;

2. Create an event object.


let createdAuctionEvent = AppcuesEvent(name: "Created auction")


AppcuesEvent *createdAuctionEvent = [[AppcuesEvent alloc] initWithName:@"Created auction" attributes:nil];

3. Add the event to an array. Add more events to this array if several events should be sent to Appcues.


let events = [createdAuctionEvent]


NSArray *events = [[NSArray alloc] initWithObjects:createdAuctionEvent, nil];

4. Call the track function whenever an event should be sent to Appcues.


Appcues.track(events: events)


 [Appcues trackWithEvents:events];

5. This is an example of how this event could look like in Xcode



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.


Ensure  Appcues.identify() or Appcues.anonymous() 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 sending in the name Added item ID=12345 to shopping cart", send in the item_id as an attribute


let attributes = ["item_id" : "12345"]
let createdAuctionEvent = AppcuesEvent(name: "Created auction", attributes: attributes)


NSDictionary *attributes = @{ @"item_id" : "12345" };
AppcuesEvent *createdAuctionEvent = [[AppcuesEvent alloc] initWithName:@"Created auction" attributes:attributes];

Targeting based on event attribute values may be added in a future version of Appcues.

Still need help? Contact Us Contact Us