Skip to content

Tracking custom events for iOS

You can record custom events in Braze to learn more about your app’s usage patterns and to segment your users by their actions on the dashboard.

Before implementation, be sure to review examples of the segmentation options afforded by custom events, custom attributes, and purchase events in our best practices, as well as our notes on event naming conventions.

Adding a custom event

1
[[Appboy sharedInstance] logCustomEvent:@"YOUR_EVENT_NAME"];
1
Appboy.sharedInstance()?.logCustomEvent("YOUR_EVENT_NAME")

Adding properties

You can add metadata about custom events by passing an NSDictionary populated with NSNumber, NSString, or NSDate values.

1
[[Appboy sharedInstance] logCustomEvent:@"YOUR_EVENT_NAME" withProperties:@{@"key1":"value1"}];
1
Appboy.sharedInstance()?.logCustomEvent("YOUR_EVENT_NAME", withProperties:["key1":"value1"])

Refer to our class documentation for more information.

Reserved keys

The following keys are reserved and cannot be used as custom event properties:

  • time
  • event_name

Additional resources

  • See the method declaration within the Appboy.h file.
  • Refer to the logCustomEvent documentation for more information.
WAS THIS PAGE HELPFUL?
New Stuff!