HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Events API Reference

This topic provides a quick reference for Optimizely Data Platform's (ODP) Events API.

Full Reference

API
Web SDK
iOS SDK
Android SDK

Quick Reference

curl -iX POST \
'https://api.zaius.com/v3/events' \
-H 'x-api-key: example.apiKey'
-d '[
  {
    "type": "product",
    "action": "add_to_cart",
    "identifiers": {
      "email": "[email protected]"
    },
    "data": {
      "product_id": "123"
    }
  },
  {
    "type": "product",
    "action": "remove_from_cart",
    "identifiers": {
      "email": "[email protected]"
    },
    "data": {
      "product_id": "123"
    }
  }
]' \
-H 'Content-Type: application/json' \
-H 'x-api-key: example.apiKey'
zaius.event("product", { action: "detail", product_id: "product-2143" });
// sending custom events with custom fields
let event = ZaiusEvent(eventType: "map", action: "explore")

// page is a field available on any event, buy primarily used for pageviews
event["page"] = "map_explorer"

// where map_region is a custom field you added to events in the Zaius App
event["map_region"] = "North America"
Zaius.event(event)
ZaiusEvent genericEvent = new ZaiusEvent("my_event_type")
  .action("my_action")
  .addField("some_other_key", "some_custom_field_value");
  
Zaius.sendEvent(genericEvent);
Coming Soon
z.event([{
    type: "yotpo_review", 
    action: "created", 
    identifiers: {
        email: "[email protected]"
    }, 
    data: {
        review_id: "12345"
    }
},{
    type: "yotpo_review", 
    action: "created", 
    identifiers: {
        email: "[email protected]"
    }, 
    data: {
        review_id: "56789"
    }
}]);

Did this page help you?