On this page
Add a custom event when your app knows something that a tap or screen transition cannot confirm. For example, a tap on Pay does not tell you whether payment succeeded.
Choose the outcome you need
Use a clear event name, such as checkout_completed. Send it when the app confirms that outcome, rather than when the user starts an action.
Add only the attributes needed to interpret it. A currency or plan can provide context. Do not include payment details, names, emails or entire request objects.
Keep event names stable. Put useful variation in supported parameters instead of creating a different event name for every product or user.
Use your platform's event API
| Integration | API and example |
|---|---|
| Android 1.2.0 | trackEvent() and trackEventTyped() |
| iOS 1.1.11 | trackEvent() |
| React Native 1.0.22 | CUX.track() |
| Flutter 0.0.27 | trackEvent() |
Android's typed API preserves simple number and boolean values. It rejects an event if any input is invalid. Its rules do not establish the behavior of another SDK's event API.
For iOS and Flutter, the examples use string parameters. Check the platform guide before passing other value types.
Avoid duplicate events
Send the event from one authoritative point in your app. A screen render, a navigation callback and a success handler can run for different reasons; do not send the same completed-outcome event from all three.
Test retries, returning to the screen and repeated callbacks. Decide which app action should produce the event and check that the recorded count matches it.
Verify an event
- Use a test account and complete the action once.
- Find the matching visit and event in CUX.
- Check the name and each expected parameter.
- Repeat the journey without completing the action. The success event should not appear.
- Inspect the data for accidental personal information.
If an Android typed event is missing, check its validation rules. Do not assume the SDK sends a partial event after discarding an invalid field.