Postbacks
AdsPostX allows publishers to receive events on revenue activity from Offers served. To enable this, please contact your account manager. Once enabled you can set your postback URL in the AdsPostX Dashboard as shown in the below playable demo.
The postback URL receives four primary pieces of information:
- The Offer's advertiser's name
- The revenue from the Offer conversion or click event
- Any payload data supplied when the Offer was served To learn how to pass payload values, visit this page.
- The timestamp when the conversion occured
If the Offer the User engaged with was a LoyaltyBoost (Rewarded Campaigns) enabled Offer, then the postback URL will additionally receive:
- If the Offer was a LoyaltyBoost enabled Offer
- The amount of Loyalty currency to reward your user
A notification is posted to the postback URL (as a POST request) soon as a revenue event associated with the Offer is recorded.
A 200 - OK response is expected from the postback URL that the notification is posted to. If this is not recieved, the system will try four more times with delay of 60s, 90s, 120s, 150s between each subsequent attempt.
There are two ways to process events sent to the postback URL.
Macros are supported in the postback URL and can be used to receive relevant payload attributes in the URL itself without having to parse the request body.
The {payout} macro will be replaced with the amount earned (in USD) from a conversion/click event on an Offer.
Any postback parameters are available in as macros as well. For example, a payload parameter passed in as subid: "post_transaction" is available in the postback URL as {sub_id1}
An example of a fully constructed postback URL is below:
The configured postback URL will also receive a JSON object in the body of a POST request. This input object has the following attributes:
- payload: the data provided to the WebSDK when serving Offers (please note that the sub_id1 value might be url-encoded)
- payout: the amount earned from a conversion/click event on an Offer (in USD)
- timestamp: the timestamp of when our tracking system recieved the conversion (in ISO 8601)
- advertiser_name: The Offer's advertiser's name.
- is_rewarded: If the Offer was LoyaltyBoost (Rewarded Campaigns) enabled, this will be present and set to true
- loyalty_payout: If the Offer was LoyaltyBoost (Rewarded Campaigns) enabled, this will be present and will be the amount of Loyalty currency to reward your user.
An example of a POST body:
An example of a POST body from a LoyaltyBoost (Rewarded Campaigns) enabled Offer: