Skip to main content

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

  1. Open the ThinkingData (TE) console and go to the Project Management page.
  2. Copy the APP ID of the project you want to send events to.
  3. If you use a private ThinkingData deployment, also copy your data receiver host from System SettingsData Receiving URL and append the /sync_json path 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

  1. Go to the Aghanim Dashboard → Aghanim ConnectThinkingData.
  2. Fill in the configuration fields (see the table below).
  3. Click the Install button to enable the integration.
FieldDescriptionRequired?
App IDThe APP ID of your project in the ThinkingData console.Yes
Receiver URLFull 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 NameCustom event name for purchase events. Defaults to purchase.No
Refund Event NameCustom event name for refund events. Defaults to refund.No
Property PrefixPrefix added to all event property names. For example, agn_ results in agn_order_id.No
Excluded Sales ChannelsPurchase 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
note

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):

PropertyTypeDescription
order_idstringThe Aghanim order ID.
item_skustringComma-separated SKUs of the items in the order.
amount_decimalnumberThe order amount in the payment currency. 0 for orders paid with Reward Points or virtual currency.
currencystringThe payment currency code. USD for orders paid with Reward Points or virtual currency.
payment_numberstring, nullThe 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_usdnumber, nullThe total order amount in USD.
revenue_decimal_usdnumber, nullFor 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]