Tracking custom events for Android and FireOS
You can record custom events in Braze to learn more about your app’s usage patterns and 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 analytics overview, as well as our notes on event naming conventions.
Adding a custom event
1
Braze.getInstance(context).logCustomEvent(YOUR_EVENT_NAME);
1
Braze.getInstance(context).logCustomEvent(YOUR_EVENT_NAME)
Refer to our KDoc for more information.
Adding properties
You can add metadata about custom events by passing a Braze properties object with your custom event.
Properties are defined as key-value pairs. Keys are String
objects, and values can be String
, int
, float
, boolean
, or Date
objects.
1
2
3
BrazeProperties eventProperties = new BrazeProperties();
eventProperties.addProperty("key", "value");
Braze.getInstance(YOUR_ACTIVITY.this).logCustomEvent(YOUR_EVENT_NAME, eventProperties);
1
2
3
val eventProperties = BrazeProperties()
eventProperties.addProperty("key", "value")
Braze.getInstance(context).logCustomEvent(YOUR_EVENT_NAME, eventProperties)
Reserved keys
The following keys are reserved and cannot be used as custom event properties:
time
event_name
Refer to our KDoc for more information.