Track Player Events
Start sending your players' events on your platform to Gameball.
Start sending your players' events on your app or platform to Gameball, along with any metadata that describes the event. Depending on your Gameball programs configuration, the player can be rewarded based on the sent events.
Every
Track Event
call records a single user action. We call these “events”. We recommend that you make your event names human-readable, so that everyone can know what they mean instantly.Event data are extra pieces of information you can tie to events you track. They can be anything that will be useful while designing your program.
Tracked events can be app events or server side events depending on how you would like to design your programs. App events can be sent to Gameball via the methods available in the SDK below. For server side events you can use Track Events API.
To send Player events from your app to Gameball, you can use the
sendEvent
SDK methods. Future<Map<String, dynamic>> sendEvent(Map<String, dynamic> eventData) async {}
Example
//Send with Meta data, send with from string then convert it to json
// or create a json and sent it directly
let eventDataString =
'''{
"buy": {
"product_id": "a123456",
"price": 30,
"product_category": "fashion"
"product_tags": ["men", "new_collection"]
}
} ''';
final Map<String, dynamic> eventData = jsonDecode(eventDataString);
gameball.sendEvent(eventData).then((response) {
print(response); // Success
}).catchError((error) {
print(error); // Error
});