Skip to main content

Track Instant Event

The setInstantEventProperties method sends an event immediately to Zeotap, bypassing the normal batching queue. Use this for high-priority events that need to be delivered without delay.

Syntax

Collect.getInstance().setInstantEventProperties(String eventName, Map<String, Object> eventProperties, SDKCallback callback)

Parameters

ParameterTypeRequiredDescription
eventNameStringYesThe name of the event to track
eventPropertiesMap<String, Object>NoKey-value pairs of event properties
callbackSDKCallbackNoCallback function to handle response

Usage Examples

Simple Instant Event

Collect.getInstance().setInstantEventProperties("payment_completed");

Instant Event with Properties

Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put("transaction_id", "TXN-12345");
eventProperties.put("amount", 99.99);
eventProperties.put("currency", "USD");

Collect.getInstance().setInstantEventProperties("payment_completed", eventProperties);

With Callback

Map<String, Object> eventProperties = new HashMap<>();
eventProperties.put("transaction_id", "TXN-12345");
eventProperties.put("amount", 99.99);

Collect.getInstance().setInstantEventProperties("payment_completed", eventProperties, (response) -> {
// Handle response
});

When to Use

  • Critical conversion events (purchases, sign-ups) where real-time delivery matters
  • Time-sensitive events that need immediate processing
  • App termination events where the batch queue may not have time to flush