Post-Install Analytics — In-App Purchase Tracking via S2S

Last Update:

The Chartboost server-to-server (S2S) PIA integration can report information about IAP events (including device identifiers, currency type, price, product ID and more) to our system.

If you have your own server, follow the steps below to set up S2S integration with Chartboost. If you do not have your own server, you can set up PIA through one of our supported third parties.

{

    "app_id": "54ecc0535beacdc1e1eff778"
    "ifa": "8c2d20ef2f4248209f65b35e3c398731"
    "iap": {
        "product_id": "com.sample.gems.001"
"currency": "EUR", "price": 3.99, "localized_description": "TheFirstGemsPack", "localized_title": "GemsPack" } }

Below is information about the S2S call itself; to receive your API token, contact Chartboost Support.

PIA S2S Request Details

Method

POST

Endpoint

https://live.chartboost.com

Path

/event_service/v3/track

Headers

(Note that headers contain authentication information.)

Header Name Example Description
X-Chartboost-Token 9782f24948b6d8125518f421f70240c415e0d25b Your API Token (please contact support.integrations@chartboost.com for your PIA API Token & API Secret)
X-Chartboost-Signature 173e6aeff28e4b76b488d5acf49ed8ebb8e95559 See this gist for a full code example of how to generate the request signature. This is NOT the same value as your Chartboost app signature!

JSON Body: iap object parameters

Parameters iOS Apps Android Apps Example Description
currency Required Required "USD" 3-letter ISO 4217 currency code
localized_description Optional Optional "A small pack of coins" Description of item in player's language
price Required Required 1.99 Price of item in the currency defined in currency parameter
localized_title Optional Optional "Small Coin Pack" Title of item in player's language
product_id Required Required "com.app.exampleapp.1234" SKU

 

Public Key/Secret Key (Google Play/Amazon Only)

If you're setting up S2S PIA for Google Play or Amazon Appstore games, you'll need also need to add your app's public key or your Amazon Developer Secret key, respectively, to a field on the game's Edit App page:

Building the Request

First, start with the endpoint:

POST https://live.chartboost.com/event_service/v3/track

Check out the code example here for a working example of how an S2S PIA postback is sent to our servers.

Successful requests will receive: {"message": "OK", "successful": 1}.

If your call receives a 5xx HTTP error code, your server should retry the request using an exponential back-off: Try again in 5 seconds, then 10 seconds, then 20 seconds, then 40 seconds, etc.. Set a max number of retries or TTL that can accommodate temporary server outages (recommended: 24 hour TTL).