setInstantEventProperties method is used to send events immediately to Zeotap, bypassing the normal queuing and batching mechanism. This is ideal for critical events that require real-time tracking.
Why use it?
- Immediate Delivery: Events are sent instantly without waiting for batch processing.
- Critical Events: Perfect for tracking urgent events like errors, crashes, or time-sensitive actions.
- Real-time Analytics: Ensures important events are captured immediately even if the app closes.
Syntax
Parameters
Usage Examples
Instant Event Name Only
If you only need to track the event name without additional properties for critical events:Instant event name only in payload
Basic Instant Event Tracking
Instant event with properties in payload
Instant Event with Callback
Performance Impact
Network Usage
- Instant events create immediate network requests
- Consider batching multiple instant events if they occur simultaneously
- Monitor data usage in your analytics
Battery Life
- Frequent instant events can impact battery life
- Use only for truly critical events
- Consider user’s network conditions
Related Methods
- setEventProperties - Track regular events with batching
- setEventNameProperties - Track events with name only
- setPageProperties - Set page/screen context
- setUserProperties - Set user attributes
For more examples and integration patterns, see our Examples Guide.