Serving Moments in Mobile Apps
To display a "moment" in a mobile app. For reference, a "moment" is either one Offer or a series/collection of Offers served together at a key time in a user's experience.
To implement a moment in a mobile app, use the Moments API (also known as the Native Ads API) to retrieve Offers from AdsPostX and then render them as you fit in your mobile app.
To return a collection of Offers via the Moments API, you will first need to get an API Key.
Note that you will need an API Key scoped for Ads.
The number of Offers returned in the Moments API response can be configured in the AdsPostX dashboard. To do this, head to Settings -> Configuration and then locate the Number of Ads setting. Select the number of ads you would like to have in a given moment. Then press Save Configuration.
This will instruct the Moments API to only return the selected number of Offers in the response.
The API call that returns a collection of Offers to be displayed may be implemented in one of two ways:
- Directly in your app
- Via a proxy solution wherein your app contacts your own backend endpoint which then "relays" the request to AdsPostX and returns to your endpoint the API response. Your endpoint will then send the response to your app.
If you opt to use a proxy solution, ensure that the end-user's user-agent and IP address are provided in the Moments API request from your proxy server to ensure appropriate geo and platform targeting.
Every Offer returned includes an impression beacon that needs to be triggered when the Offer is displayed to the user. This is important to implement to ensure correct reporting. Failing to implement the impression beacon will result in inaccurate reports as well as the inability to provide eCPM performance on an individual Offer basis. It also hinders the platform's ability to optimize offer ranking and ultimately revenue yield.
Consider using postbacks to get real-time events on conversions based on the Offers that are served.