Events

Send events to capture customer actions, enabling targeted rewards and engagement. These events help build personalized experiences and drive customer interaction based on their behavior.

Available APIs


POST - Send Events

https://api.gameball.co/api/v4/integrations/events

This API is how you record any actions your users perform, along with any properties that describe the action.Each event has a name (e.g., place_order) and can include properties like amount or source. Tracking these events is a foundational step in using Gameball, helping to monitor user behavior. The API accepts a collection of events to track multiple actions simultaneously. For further details, refer to the article in our Help Center.

Security: Requires apikey and secretkey headers.

Channel Merging Available If your system uses different customer IDs across multiple channels (e.g., online and offline), Gameball's channel merging feature helps unify customer profiles. By including the customer’s mobile number or email (based on your merging configuration) with each request, Gameball will combine activities into a single profile.For more information, head to the Channel Merging Guide.

Request

Body

application/json

customerId string Required Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.


events object Required

An object containing one or more events, each represented by its event name as the key, and an associated object containing metadata related to the event. The structure of the event object can vary depending on the specific event being recorded. Events can be any significant action a customer performs, such as making a purchase, writing a review, adding to cart, etc.

The events object holds one or more events as keys (e.g., write_review, place_order, etc.), where each key is the event name, and its value is an object that can include metadata, providing additional details about the event. The metadata inside each event can vary depending on the nature of the event, but it usually contains properties that help describe the specifics of that event, such as product IDs, order amounts, or timestamps.

How the Event Object Works:

  • Each event key corresponds to a specific customer action.

  • Inside each event, the metadata can contain relevant attributes, such as item or transaction identifiers, descriptions, or other properties that describe the action in more detail.

This allows you to track and monitor important actions that a customer takes within your platform. These events can later be used for analysis, rewarding customers, or triggering automation.

Event Object

EventName : This is the name of the event that represents the action taken by the customer. Common event names include actions such as write_review or place_order. Each event name is unique and corresponds to a specific type of activity. The event name is used as the key in the events object.

EventMetadata: These are optional but recommended fields that give additional context to the event. They can include information such as product details, transaction amounts, or other relevant data. Metadata can be a string, number, or an array of values.

Examples :

  • Product Review: If a customer writes a review on a product they purchased, you can track this as an event (write_review) with metadata that includes the product_id, the content of the review, and the rating the customer provided.

{ "write_review": {
      "product_id": "1653503260",
      "review": "Great product, highly recommend!",
      "rating": 5
    }}
  • Order Placement: If a customer places an order, the place_order event can be recorded with metadata like the order_id, order_amount, and possibly a list of products or payment details.

{
  "place_order": {
      "order_id": "ORD12345",
      "order_amount": 150.75,
      "currency": "USD",
      "payment_method": "Credit Card"
    }
 }

Sample Request

{
  "customerId": "1848877205",
  "events": {
    "write_review": {
      "product_id": "1653503260",
      "review": "5 Stars Product"
    }
  }
}

Last updated