Treasure’s Analytics Service (codename DarkMatter) is a powerful, scalable and real-time streaming data platform 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.

Currently, ingestion is only possible via AWS SNS, with more delivery methods in the works. We’ll be adding support for HTTP, Kafka and AWS Kinesis and will update this page as new delivery methods are added.

AWS SNS

Simply write single or batch event data to an SNS Topic in your AWS account, configure and access policy and transmit away!

SNS Topic Access Policy

{
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "<Treasure AWS Account ID>"
      },
      "Action": "sns:Subscribe",
      "Resource": "arn:aws:sns:<Your AWS account region>:<Your AWS Account ID>:<Your Topic Name>"
    }
  ]
}

The Treasure team will provide values for both Dev and Prod accounts.

Message format

Messages need to be in the following format, and multiple events can be included in the batch array.

[
    {
        "smart_account": "<smart account or wallet address>",
        "chain_id": <chain id (number)>,
        "cartridge_tag": "<cartridge tag for game  - check with Treasure team e.g. zeeverse>",
        "name": "<name of event - check with Treasure team e.g. my_event>",
        "session_id": "<unique session id (if available) e.g. 5076f1bb49ca4156a229fbb23ee7450f>",
        "id": "<unique id for event e.g. 10016ada185840db9e9250d76290303b>",
        "time_server": <unix/epoch time of event collection e.g. 1712162689906>,
        "properties": {
            "custom_event_key": "hello world",
            "custom_event_key_2": false,
        },
        "device": {
            "device_name": "<device name if known>",
            "device_model": "<device model if known>",
            "device_unique_id": "<unique identifier for device>",
            "device_os": "<device os if known>",
        },
        "app": {
            "app_identifier": "bundle/package name of ap e.g. lol.treasure.tdkunity",
            "app_version": "<version of app e.g. 0.1>",
            "app_environment": <0 for dev, 1 for prod>
        }
    },
]