Tracking Custom Events

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 vs. Custom Attributes vs Purchase Events in our Best Practices section.

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

See our class documentation for more information.

Reserved Keys

The following keys are RESERVED and CANNOT be used as Custom Event Properties:

  • time
  • product_id
  • quantity
  • event_name
  • price
  • currency

Implementation Example

logCustomEvent is utilized within EventsViewController.m file in the Stopwatch sample application.

WAS THIS PAGE HELPFUL?