HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In


This topic describes how send events using the Optimizely Data Platform (ODP) React Native SDK.

Events are the main way that an app communicates with ODP. You can find more about Events in the Events section of this guide.

Sending Events

The main way of sending events to ODP is with Zaius.event():

    type: string,
    action: string,
    identifiers: {
    data: {



The type of event. You can think of it as what the event is happening about.
You can find more about this in the Events sections of this guide.


What the customer is doing about which ODP should be told.


Various bits of information that can identify a Customer. This will include things like the VUID, push token, or email.

Values in this object should be strings.


Relevant data to the event.

For example, the event sent when push notifications permission is granted will also contain the push token for the phone (so ODP can actually deliver notifications). The values here should be strings.

Event Queue

Each time an event is sent to ODP via Zaius.event() or automatically, it gets enqueued into the Event Queue—the event is not sent immediately.

The Event Queue holds on to the pending events. It is flushed out every 30 seconds and all pending requests are made to ODP. Each time a new event is added, the queue state is persisted to survive app quits and crashes. Queueing this way allows for more efficient network communication in a way that does not interrupt your customer's flow.

If the startQueue option to Zaius.configure() is true, the queue will start processing events as soon as it can load them from the phone's storage.

If startQueue is false, then the Queue must be started manually by calling z.queue.start() (where z is the return value of Zaius.configure()).



Setting startQueue to false is NOT recommended.

Automatic Events

Some events are sent automatically by the SDK . They are:

  • Add Push Token: This event is sent when the phone finishes registering for push notifications. If this event gets sent, then the phone is capable of receiving pushes.
  • Push Notification Open: This event is sent when the user taps on a push notification.



On Android, the notification will always show. On iOS, the notification will only show if the app is in the background.

Did this page help you?