Skip to main content

How to Send a Custom Event

Send a Single Field

Send a Object

Data TypeExample KeyExample Value
String”productName""Headphones”
Int / Long”quantity”2
Boolean”isNewUser”true
Double / Float”price”199.99
JSONArray”tags”[“electronics”, “audio”]
JSONObject”userInfo”{ “id”: “u123”, “age”: 28 }
null”discount”null
(Not allowed. Avoid using null in eventProperties. Use "0", "unknown", or remove the key.)
📝 Note
Only primitive types, JSONArray, and JSONObject are allowed inside eventProperties.
Avoid passing complex objects or custom class instances directly. Convert them to JSON first.

💡 All properties must be JSON-serializable. Also, avoid passing null values.

Example of Custom Event Payload: Supported Data Types

Understand the types of data you can pass inside eventProperties and how to structure complex objects.
Follow these guidelines to help users name, structure, and send custom events effectively.
  1. Naming Guidelines
    • Use camelCase or snake_case for event names (e.g., purchaseCompleted, user_logged_in)
    • Keep names short and descriptive
    • Avoid spaces or special characters
  2. Event Structure
    • Use consistent keys (e.g., always use "productId")
    • Include only relevant attributes
    • Skip redundant or unused properties
  3. Avoid These Mistakes
    • Don’t send raw classes — always serialize to JSON
    • Avoid high-cardinality keys (e.g., UUIDs, timestamps)
    • Never pass null — use "unknown" or remove the key