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 metadata 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.
For more information about events and usage examples, check Tracking Player Events tutorial
To send Player events from your app to Gameball, you can use the sendActionWithMetaData or sendActionWithOutMetaData SDK methods. Each is used in a seperate case where sendActionWithMetaData is used if the tracked event has metadata attributes and sendActionWithOutMetaData is used if the tracked event has no metadata.

Send Event With Metadata

1
self.gameballApp?.
2
sendActionWithMetaData(events: [String : [String : Any]], completion: { (responseMessage, error) in
3
}))
Copied!
Example
1
//Send with Meta data
2
let eventsWithMetaData: [String : [String : Any]] = ["Buy": ["Amount":100,"Location":"Alex"]]
3
self.gameballApp?.sendActionWithMetaData(events: eventsWithMetaData , completion: { (response, errorMsg) in
4
DispatchQueue.main.async {
5
self.showAlert(msg: response ?? "Falied to Send Action")
6
}
7
})
Copied!

Send Event Without Metadata

1
self.gameballApp?.
2
sendActionWithOutMetaData(events: [String : Any], completion: { (responseMessage, error) in
3
})
Copied!
Example
1
//Send without Meta data
2
let eventsWithOutMetaData: [String : Any] = ["Buy": "Amount"]
3
self.gameballApp?.sendActionWithOutMetaData(events: eventsWithOutMetaData, completion: { (response, errorMsg) in
4
DispatchQueue.main.async {
5
self.showAlert(msg: response ?? "Falied to Send Action")
6
7
}
8
})
Copied!
Last modified 2mo ago