Aghanim-ThinkingData Integration
This guide explains how to integrate Aghanim with ThinkingData to streamline player analytics and tracking. By connecting Aghanim with ThinkingData, you can track purchases and refunds made by your players on the Game Hub and other sales channels, allowing you to correlate Aghanim commerce events with analytics from your game.
Aghanim sends events to ThinkingData server-side via the ThinkingData REST API, so no client-side setup is required.
Requirements
- A ThinkingData account with a project created in the TE console.
- Access to your project's APP ID.
Step 1: Get Your Project Credentials in ThinkingData
- Open the ThinkingData (TE) console and go to the Project Management page.
- Copy the APP ID of the project you want to send events to.
- If you use a private ThinkingData deployment, also copy your data receiver host from System Settings → Data Receiving URL and append the
/sync_jsonpath to it — for example,https://receiver.example.com/sync_json. For SaaS projects, the default global endpoint is used automatically.
Step 2: Configure the Integration in Aghanim
- Go to the Aghanim Dashboard → Aghanim Connect → ThinkingData.
- Fill in the configuration fields (see the table below).
- Click the Install button to enable the integration.
| Field | Description | Required? |
|---|---|---|
| App ID | The APP ID of your project in the ThinkingData console. | Yes |
| Receiver URL | Full ThinkingData raw data receiver endpoint ending in /sync_json (for private deployments). Defaults to the global ThinkingData endpoint (https://global-receiver-ta.thinkingdata.cn/sync_json) if not specified. | No |
| Purchase Event Name | Custom event name for purchase events. Defaults to purchase. | No |
| Refund Event Name | Custom event name for refund events. Defaults to refund. | No |
| Property Prefix | Prefix added to all event property names. For example, agn_ results in agn_order_id. | No |
| Excluded Sales Channels | Purchase events from the selected sales channels (Game Hub, Checkout, SDK, Checkout links) will not be sent for tracking. Refund events are sent regardless of this setting. | No |
Custom event names and property names (including the prefix) must follow the ThinkingData naming rules: start with a letter, contain only letters, digits, and underscores, and be at most 50 characters long. These values are not validated when you save the configuration, so make sure the prefixed property names — for example, <prefix>total_amount_decimal_usd — stay within the limits.
Step 3: Verify the Integration
The integration does not send a test request to ThinkingData when you install it, so an incorrect App ID or receiver URL surfaces only when the first event is sent. To verify the setup, complete a test purchase through a sales channel that is not listed under Excluded Sales Channels, then check that the purchase event appears in your ThinkingData project with the expected #account_id and properties (see below). To verify refund tracking, refund the test order and check that the corresponding refund event appears.
Events Sent to ThinkingData
Once the integration is set up, Aghanim automatically sends purchase and refund events for players' orders. Events are tracked with #account_id set to the player's Aghanim Player ID, so you can match them with events from your game. The event #time is the order creation time for purchase events and the refund time for refund events.
Each event includes the following properties (with the configured prefix applied, if any):
| Property | Type | Description |
|---|---|---|
order_id | string | The Aghanim order ID. |
item_sku | string | Comma-separated SKUs of the items in the order. |
amount_decimal | number | The order amount in the payment currency. 0 for orders paid with Reward Points or virtual currency. |
currency | string | The payment currency code. USD for orders paid with Reward Points or virtual currency. |
payment_number | string, null | The human-readable receipt number of the payment. null for orders without a payment provider receipt, such as orders paid with Reward Points or virtual currency. |
total_amount_decimal_usd | number, null | The total order amount in USD. |
revenue_decimal_usd | number, null | For purchase events, customer revenue in USD. For refund events, the revenue change caused by the refund, sent as a negative value (or 0). |
Need help?
Contact our integration team at [email protected]