Amazon Publisher Services
This article is for publishers who want to use the DT FairBid SDK to load and display ads from Amazon Publisher Services (APS).
APS currently supports the following ad types:
Banner
Interstitial
Rewarded
To integrate APS as a mediated ad network with DT:
Step 1: Retrieve APS Information
Before retrieving your APS information, complete the following tasks to create APS ad unit inventory to mediate with DT. For more information about how to create APS inventory, see the APS Portal documentation.
Create an APS account.
Amazon Publisher Services (APS) is an invitation-only program. To create an APS account, request an invitation from APS. Once approved, APS sends an invitation with instructions on creating your APS account.
Add your app to the APS Portal.
Add Slots for your app.
Update your
App-ads.txtfile to include the APS Portal.
Once you have created APS inventory, locate the following information in the APS Portal. This information is required later in Step 2 to set up APS as a DT mediated network.
Price Point Mapping
CSV file containing ad unit pricing.
Download CSV file. For more information about where to find the file, see the APS Portal documentation.
UUID
Unique ID assigned to your APS ad slot.
For more information about how to locate UUIDs, see the APS Portal documentation on UUIDs.
Step 2: Add APS as a Mediated Network
Before you add APS as a DT mediated network:
Ensure that you have access to the APS Portal information you retrieved in Step 1.
Add your App using the DT Console.
Ensure that you set up a DT Placement for each APS ad type you want to mediate with DT.
To add APS as a DT mediated network:
Log in to the DT Console, and click App Management.
DT uses the price point mapping across your entire account. If you update your price points in APS, ensure that you upload an updated CSV file in the DT Console.
For each Placement that you want to mediate with DT, create an ad network instance for APS with the following settings:
Use the APS UUID you retrieved in Step 1 as the Instance ID.
Turn off the Auto CPM function. For more information about how to turn off Auto CPM, see Auto CPM. For more information about how to add instances to a Placement, see Setting Up Instances.
Step 3: Initialize the APS SDK
Initialize the APS SDK within your app so that DT can mediate your APS inventory:
Initializing the APS SDK on Android
The following process is recommended for initializing the APS SDK in either Java or Kotlin implementations on the Android platform.
Start DT FairBid SDK with your DT
APP_ID.
Start the APS SDK with the
APP_KEYconfigured on your APS Portal.
Create an object that implements the
SlotLoaderinterface, and register it to DT FairBid SDK withAPSAdapter.slotLoader.Implement a Banner ad callback to trigger whenever you call
Banner.show(placementId, activity)for a placement configured with an APS instance in the waterfall.
Implement an Interstitial ad callback to trigger whenever you call
Interstitiat.request(placementId)for a placement configured with an APS instance in the waterfall.
Implement a Rewarded ad callback to trigger whenever you call
Rewarded.request(placementId)for a placement configured with an APS instance in the waterfall.
Create an object that implements the
DTBAdCallback.Implement the
onSuccesscallback, and extract the following parameters and pass them back to FairBid viaAPSAdapter.setBidInfo(slotUUID, encodedPricePoints, bidInfo):Encoded price points
Bid info
(Optional) Implement the
onFailurecallback to receive error messages when APS cannot fill a slot.
Example: Android Implementation
Initializing the APS SDK on iOS
The following process is recommended for initializing the APS SDK in Objective–C implementations on the iOS platform.
Start the FairBid SDK.
Start the APS SDK with the
APP_KEYfrom the APS Portal.
Create an object that conforms to the
id <FYBAPSSlotLoader>protocol, and assign it to the[FairBid apsAdapter].slotLoaderproperty.Implement a Banner ad callback to trigger whenever you call
+ [FYBBanner showBannerInView:position:options:]for a placement with an APS instance in the waterfall.
Implement a Rewarded ad callback to trigger whenever you call
+ [FYBRewarded request:placementId]for a placement with an APS instance in the waterfall.
Implement a Interstitial ad callback to trigger whenever you call
+ [FYBInterstitial request:placementId]for a placement with an APS instance in the waterfall.
Example: iOS Ad Slot Loader
Create object that conforms to
id <DTBAdCallback>protocol.Implement the
-onSuccess:callback, and pass the following parameters back to FairBidSDK by calling-[[FairBid apsAdapter] setBidInfo:encodedPricePoint:slotUUID:].
adResponse.bidInfoadResponse.amznSlotsadResponse.adSize.slotUUID
(Optional) Implement the
-onFailure:callback to receive error messages when APS cannot fill a slot.
Example: iOS Ad Callbacks
Initializing the APS SDK on Unity
The following process is recommended for initializing the APS SDK on the Unity platform.
Add the following dependencies to
mainTemplate.gradle:
Note
FairBid is already added as a dependency; however, to access the APIs from the unityLibrary project, add them as a compileOnly dependency.
To avoid conflicts with duplicate entries for
META-INF/com.android.tools/proguard/coroutines.pro, add the following code tolauncherTemplate.gradle:
If your minimum API level is below 19, add the following snippet to
LauncherManifest.xml:
Create the
Assets/APS Compatdirectory, and addAmazonAPS.java(provided below) to the directory.
Open the Unity Inspector, and check Android on the Select platforms for plugin pane.

Start APS by adding the
startcall inside any of your methods in the C#. For example, you can add it right after starting FairBid.
Build and run your app.
Step 4: Add the APS SDK to your Integration
To integrate the APS SDK, follow the instructions on the Supported Networks page.
Step 5: Test Your Integration
Use the DT Test Suite to verify that you have set up your app properly for FairBid mediation. The DT Test Suite is available for Android, iOS, and Unity apps. For more information about using the DT Test Suite, see Test Suite.

Last updated
