Connect activity to an internal account ID and record outcomes your app confirms, such as a completed checkout. Initialize the SDK and allow collection before using these examples.
Package covered: @cuxio/react-native-sdk 1.0.22.
Identify users
After a successful login, send the active account's internal ID:
import { CUX } from '@cuxio/react-native-sdk';
await CUX.setUserProperties('account-123');
Use an ID from your own system. Do not send an email address, phone number or full name. Basic mobile collection does not require a user ID.
Test login, logout and switching accounts on the same device. Do not use CUX.reset() or collection controls as proof that the previous identity was cleared. Confirm the supported account-change approach with CUX before relying on it on shared devices.
See Identify mobile users for identifier choices and verification steps.
Track custom events
Use the exported CUX.track() method when your app confirms an outcome:
CUX.track('checkout_completed', {
currency: 'USD',
plan: 'pro',
});
CUX.customEvent() is not the API covered by this package. The example uses simple string values; it does not claim Android's typed-event validation through the wrapper.
Avoid duplicate events
Send an event from the handler that confirms the outcome. Do not also send it from a screen render or a navigation callback. Check retries and repeated callbacks in your app.
Screenshot masks do not filter IDs or event parameters. Send only the values needed to explain the outcome.
Verify users and events
Use two synthetic accounts. Complete the action once and check the active identifier, event name and parameters in CUX. Repeat the journey without completing the action and confirm that the success event does not appear. Check account switching separately.
If the result is missing, follow React Native troubleshooting.