Skip to main content

Send Events Using the SDK

Send events to Gameball to power actions, campaigns, and rewards. Events represent significant customer actions within your app—such as purchases, product interactions, or engagement milestones.
🔒
Secure API Access: To benefit from v4.1 secure API endpoints, pass the sessionToken parameter when sending events (required in upcoming SDK v4). This enables automatic routing to v4.1 secure endpoints. Learn more about v4.1 →

Event Parameters

string
required
Unique identifier for the customer performing the event.
string
required
Name of the event (e.g., "purchase", "review", "add_to_cart").
Map<String, Any>
Extra contextual information about the event (amount, product details, category, etc.).
string
Optional session token to override the global token for this specific request. Required in upcoming SDK v4.

Validation Rules

An event requires:
  • Customer ID is not empty
  • Event name must be provided
  • Metadata values (if provided) must be valid primitive types or objects

Best Practices

1

Use Clear Event Names

Make event names human-readable and consistent (e.g., purchase_completed, review_submitted).
2

Send After Action Completion

Only send events when the action is fully completed (e.g., after successful payment confirmation).
3

Include Relevant Metadata

Add metadata that supports segmentation and campaign targeting.
4

Keep Metadata Keys Consistent

Use consistent naming across events (e.g., always amount, not sometimes price).

Common Event Examples

1. Purchase Event

2. Review Event

3. Add to Cart Event

Events are the foundation of Gameball’s reward and engagement engine. Configure event triggers and reward rules from your Gameball dashboard.
Consider showing the profile widget immediately after a customer earns points or unlocks a reward to reinforce engagement.