track() records a business event and evaluates whether any campaign rule should trigger a mechanic.
Usage
Parameters
string
required
User identifier from your system. Example:
user-123.string
required
Campaign ID that should evaluate the event. Example:
camp-abc.string
required
Event type configured in the rule. Example:
card.purchase.completed.object
default:"{}"
Event data used by rule conditions. Example:
{ "value": 500 }.string
default:"request receipt time"
ISO 8601 timestamp for when the event occurred.
Response
array
Mechanics triggered by the event. Empty when no rule matched.
string
ID of the triggered spin.
string
Campaign ID that triggered the spin.
string
Rule ID that triggered the spin.
track() does not return the spin result. The result arrives through the spin.completed webhook.
