Analytics Ingestion
Treasure’s Data Platform (codename Darkmatter) is a powerful, scalable and real-time streaming analytics service that allows developers to collect data from games. This data can be used to understand player behaviour, improve game design, and optimize your game’s performance. In the future, this data will power various downstream services such as player segmentation, A/B testing, and more.
Prepare your payload
Messages need to be in the following format, and multiple events can be included in the batch array.
Push analytics events to Treasure
From your backend, push your event payloads to our infra. You can choose from the following methods: Kafka, HTTP POST, or AWS SNS.
There is no need for you to set up your own Kafka cluster with this approach. Just send messages to a dedicated Redpanda Kafka topic that Treasure manages for you.
If you are using the Kafka option, prepare each payload as a single JSON object. If you need to batch them together, you can use the Kafka client API to send a batch of single messages.
- Receive Kafka client credentials (username, password, bootstrap URL) from Treasure.
- Send your JSON payloads using a Kafka producer client. Kafka client libraries are available in a number of languages. The following example is in TypeScript (assumes you have already installed
kafkajs@2.2.4
):