Handling Postback Events
adspostx is now momentscience! momentscience! 🎉 we have rebranded adspostx to momentscience all the latest documentation and updates can now be found at momentscience documentation https //docs momentscience com/ introduction postbacks are notifications sent to your designated url whenever a revenue event associated with an offer is recorded this guide explains how to set up and handle these events setting up postback url you can access the adspostx dashboard to set your postback url for more detailed information, view the following playable demo information received the postback url receives the following information offer id and associated advertiser's name (if available) revenue from the offer conversion or click event payload data that was supplied when the offer was served (learn more about passing payload values docid 4xbsdmzcxki2b4tfkrjji ) timestamp of the conversion the system expects a 200 ok 200 ok response from the postback url if this response is not received, the system retries four more times, with delays of 60s, 90s, 120s, and 150s between each subsequent attempt additional information for loyaltyboost offers if the engaged offer has the loyaltyboost (rewarded offers) docid\ am3pih0vwdufyueh4emrp enabled, then additional information is received notification posting as soon as a revenue event tied to the loyaltyboost offer is recorded, a notification is promptly sent to your postback url this occurs in the form of a post request handling postback events there are three methods to process events sent to the postback url querystring method 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 represents the amount earned (in usd) from a conversion/click event on an offer any postback parameters are available as macros for instance, a payload attribute like user id is accessible in the postback url as {user id} example of a fully constructed postback url https //postback domain com/pb?payout={payout}\×tamp={timestamp}\&offer id={offer id}\&advertiser name={advertiser name}\&is loyaltyboost={is loyaltyboost}\&confirmationref={confirmationref}\&user id={user id} post method when using the post method, the configured postback url will receive a json object in the body of the post request this object contains the following attributes attribute description offer id the id associated with the offer event payload data provided when serving offers payout the amount earned from conversion/click event on an offer (in usd) timestamp the timestamp when the conversion was received by our tracking system (in iso 8601 format) advertiser name the name of the offer advertiser is loyaltyboost indicates whether the offer was loyaltyboost enabled, set to "1" if true in the following example, two payload attributes ( confirmationref and user id ) were passed when serving the offer you can include any number of payload attributes to be returned in the postback response an example of a post body { "offer id" "1511", "advertiser name" "adspostx", "payout" "2 10", "payload" { "confirmationref" "a90310222", "user id" "3410444" }, "timestamp" "2023 09 20t15 27 40 802z", "is loyaltyboost" "0" } get method another method to handle postback events is through the get method with this approach, the postback url can receive parameters directly appended to the url itself these parameters contain all relevant information about the event, such as offer id, payout, timestamp, advertiser name, and more the url structure allows for easy retrieval and parsing of event data without the need for a request body example of a get url https //postback domain com/pb?payout=2 10\×tamp=2023 09 20t15 27 40 802z\&offer id=1511\&advertiser name=adspostx\&is loyaltyboost=0\&confirmationref=a90310222\&user id=3410444 in this example url payout represents the amount earned (in usd) from a conversion/click event on an offer timestamp indicates the timestamp when the conversion was received by the tracking system (in iso 8601 format) offer id refers to the id associated with the offer event advertiser name specifies the name of the offer advertiser is loyaltyboost indicates whether the offer was loyaltyboost enabled, with a value of "0" for false and "1" for true confirmationref and user id other payload attributes passed when serving the offer, accessible directly in the url for easy retrieval handling postback events with loyaltyboost offers when a postback is sent to your postback url for a loyaltyboost offer, the payload structure remains the same as for non loyaltyboost offer events, except for the " is loyaltyboost " attribute, which will be returned as "1" in this scenario, you'll need to examine the child "payload" object to find an attribute passed into the tracking link that identifies the user you intend to reward need help? 📢 if you're running into any issues while going through the integration process, feel free to contact us at help\@adspostx com