APS Mediation Ad Source
DETAILS |
|
Ad Source Name |
Amazon Publisher Services (APS) |
Ad Products Supported |
aerWall Non-Rewarded aerBanner |
Ad Formats Supported |
Banner HTML Interstitial HTML Video |
Ad Source Type |
SDK |
Website |
GUIDELINES |
|
Table of Contents
2.1 Setting Up an Account with APS
2.2 Getting the Required APS Attributes
3. Setting Up the APS Ad Source in AerServ
4. Integrating APS via AerServ
4.2 iOS Instructions
1. How AerServ + APS Works
1
|
Call the APS SDK prior to the AerServ SDK. |
2
|
The APS SDK will return a response object that includes the key value pairs within it that are necessary for the ad sever lookup (bidID, hostname, price, SlotUUID). |
3
|
Please pass this response object directly to the AerServ SDK without altering it. |
4
|
The AerServ SDK will parse the object and extract the key value pairs and pass them to the AerServ Ad Server. |
5
|
The AerServ Ad Server will fetch the creative that matches the Key Value pair passed in to the AerServ Ad Server and send the creative back to the AerServ SDK. |
6
|
The AerServ SDK will then render the APS ad in AerServ view. |
2. Prerequisites
2.1 Setting Up an Account with APS
Please ensure you already have an account setup with APS. AerServ is unfortunately not able to assist with your APS integration.
2.2 Getting the Required APS Attributes
In order to set up a new APS ad source in the AerServ UI, you will need to collect the following network attributes for APS:
"APS Ad Markup" - Required
If you already have an account set up with APS, your APS Ad Markup is the JS Tag for banner and interstitial ads and the VAST Tag URL for video ads that is associated with the amznslots where macros are switched to AerServ Macros.
Your Ad Markup should follow the formats below and can be formatted with the help of your APS account manager. The samples below already have the AerServ macros (${PRICE_POINT}, ${BID_ID}, ${HOST_NAME}, ${CB}) inserted within them.
Banner Ad Markup:
<div style="display:inline-block">
<div id="__dtbAd__" style="width:320px; height:50px; overflow:hidden;">
<!--Placeholder for the Ad -->
</div>
<script type="text/javascript" src="mraid.js"></script>
<script type="text/javascript" src="https://c.amazon-adsystem.com/dtb-m.js"></script>
<script type="text/javascript">
amzn.dtb.loadAd("${PRICE_POINT}", "${BID_ID}", "${HOST_NAME}");
</script>
</div>
Video VAST URL:
https://aax.amazon-adsystem.com/e/msdk/vast?b=${BID_ID}&rnd=${CB}&ps=${PRICE_POINT}
Be sure to replace the APS macros with the following AerServ macros in your APS Ad Markup so that the AerServ Ad Server can replace them with the appropriate values. Feel free to reach out to your AerServ Account Manager if you have any trouble identifying what to replace.
- Price Point Macro: ${PRICE_POINT}
- Bid ID Macro: ${BID_ID}
- Hostname Macro: ${HOST_NAME}
- Cache Buster Macro: ${CB}
"APS Price Point" - Required
If you already have an account setup with APS, your APS Price Point is the equivalent of "amznslots" in APS.
Price Points are not available in the APS UI, but can be retrieved from your APS account manager. They are required for AerServ to map the correct creative to your newly created AerServ APS Ad Source.
Examples of price points you may receive from your APS account manager are as follows:
- mVp1:1
- mVp2:2
- mVp3:3
- Etc.
When inputing the price point into the AerServ UI, please use only the portion before the colon, for example:
- mVp1
- mVp2
- mVp3
- Etc.
3. Setting Up the APS Ad Source in AerServ
3.1 Creating a New Ad Source
Log in > Ad Sources Tab > Ad Networks Sub Nav > + New Ad Source Button
3.2 Completing Basic Fields for APS
Field |
Description |
Required/Optional to Go Live |
---|---|---|
Name |
Enter a Name for your new ad source (example: APS Interstitial) and select 'Amazon Publisher Services (SDK)' from the ad source dropdown. We recommend including the APS Price Point in the name so it can be easily identified in reporting. |
Required |
Ad Source |
Select 'APS (SDK)' from the dropdown menu. |
Required |
Ad Type | Select from Interstitial HTML, Banner HTML, or Video in the Ad Type dropdown menu. | Required |
APS Ad Markup | The JS Tag for banner or interstitial ads or VAST Tag URL for video ads associated with the amznslots where macros are switched to AerServ Macros. See step 1.2 | Required |
APS Price Point | The equivalent of "amznslots" in APS and can be retrieved from your APS account manager. | Required |
CPM | Enter a CPM (example: 3.50). This value is used as the default CPM, not the floor. It should be set to the same value as “amznslots” in APS’s UI. | Required |
Placements | Select a placement(s) to assign this ad source to. | Required |
Targeting |
Select any desired geo or device targeting. |
Optional |
Be sure to hit the SAVE button once you're done entering all values for the fields above.
4. Integrating APS via AerServ
4.1 APS Android SDK Instructions
Steps 1, 2, 3.1 and 3.2 below must be done outside the AerServ SDK and prior to sending the APS Response Object to the AerServ SDK.
- Make sure that whichever class is calling the APS SDK is a delegate of DTBAdCallback
- Unlike all the other mediation adapters, for APS we will need to start with an import to init and use their AdLoader.
-
import com.amazon.device.ads.*;
- Initialize APS SDK with the correct AppKey
-
a9_onboarding_app_id
-
-
AdRegistration.getInstance(APP_KEY, this);
- APP_KEY should be from your APS account. Please contact your account manager.
- In the meantime, you may use a test APP_KEY to validate your integration:
-
a9_onboarding_app_id
- How to request an ad from APS SDK
- Init a DTBAdLoader and setSizes
-
DTBAdLoader adLoader = new DTBAdRequest();
-
adLoader.setSizes(new DTBAdSize.DTBInterstitialAdSize(SLOT_INTERSTITIAL)); adLoader.setSizes(new DTBAdSize(300, 250, SLOT_ID));
- Sample SLOT_ID:
-
A9_SLOT_320x50 = "5ab6a4ae-4aa5-43f4-9da4-e30755f2b295"; A9_SLOT_300x250 = "54fb2d08-c222-40b1-8bbe-4879322dc04b"; A9_SLOT_INTERSTITIAL = "4e918ac0-5c68-4fe1-8d26-4e76e8f74831";
- Call loadAd from the ad loader
-
adLoader.loadAd(new DTBAdCallback(){//override callback methods (onSuccess and onFailure) here });
- Callback from APS
- On Success public void onSuccess(DTBAdResponse dtbAdResponse)
- Pass the returned DTBAdResponse object to Aerserv Android SDK without altering it.
-
List<DTBAdResponse> responses = new ArrayList<DTBAdResponse>();
-
responses.add(dtbAdResponse);
-
AerServConfig config = new AerServConfig(MainActivity.this, getPlc()).setA9AdResponses(responses)
- Response objects will include values inside of it similar to what is included in these sample responses (please refer to APS documentation and your APS Account Manager for any additional information):
- Video
-
{"ads":{"mVp0":{"b":"BID_ID","ps":"mVp0","kvp":{"dc":["pdx"]},"v":true,"sz":"100x100"}},"instrPixelURL":"https://aax-us-east.amazon-adsystem.com/x/px/","errorCode":"200","request_id":"0AAA0aaaAA00AaaAA0a0aa","status":"ok"}
- Banner
-
{"ads":{"o300x250p0":{"b":"BID_ID","kvp":{"amznp":["aaaaa0"],"dc":["pdx"]},"sz":"300x250","i":"https://aax-us-east.amazon-adsystem.com/e/msdk/imp?b=AAA&ps=o300x250p0"}},"instrPixelURL":"https://aax-us-east.amazon-adsystem.com/x/px/","errorCode":"200","request_id":"AaaaaaAaAAaAAaaa.AAAAa","status":"ok"}
- On failure public void onFailure(AdError adError)
- No DTBAdResponse was given back
- On Success public void onSuccess(DTBAdResponse dtbAdResponse)
4.2 APS iOS SDK Instructions
Steps 1, 2, 3.1, 3.2 and 3.3 below must be done outside the AerServ SDK and prior to sending the APS Response Object to the AerServ SDK.
- Make sure that whichever class is calling the APS SDK is a delegate of DTBAdCallback
- Unlike all the other mediation adapters, for APS we will need to start with an import to init and use their AdLoader. You can find the framework under network-support/APS.
-
#import <DTBiOSSDK/DTBiOSSDK.h> // (obj-c) import DTBiOSSDK // (swift)
- Initialize APS SDK with the correct AppKey
-
[[DTBAds sharedInstance] setAppKey: appKey];
- APP_KEY should be from your APS account. Please contact your account manager.
- In the meantime, you may use a test appKey to validate your integration:
-
a9_onboarding_app_id
-
- How to request an ad from APS SDK
- Init an ad size
- Interstitial video
-
DTBAdSize *interstitialSize = [[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth:wd height:ht andSlotUUID:slotUUID];
-
- Interstitial
-
DTBAdSize *interstitialSize = [[DTBAdSize alloc] initInterstitialAdSizeWithSlotUUID:slotUUID];
-
- Banner
-
DTBAdSize *bannerSize = [[DTBAdSize alloc] initBannerAdSizeWithWidth:wd height:ht andSlotUUID:slotUUID];
-
- Interstitial video
- Init a DTBAdLoader and setSizes
-
DTBAdLoader *adLoader = [DTBAdLoader new];
-
[adLoader setSizes:interstitialSize, nil]; var bannerSizes = [DTBAdSize]() bannerSizes.append(DTBAdSize(bannerAdSizeWithWidth: 320, height: 50, andSlotUUID: kA9Banner320X50SlotId))
- Sample SLOT_ID:
-
A9_SLOT_320x50 = "5ab6a4ae-4aa5-43f4-9da4-e30755f2b295"; A9_SLOT_300x250 = "54fb2d08-c222-40b1-8bbe-4879322dc04b"; A9_SLOT_INTERSTITIAL = "4e918ac0-5c68-4fe1-8d26-4e76e8f74831";
-
- Call loadAd from the ad loader
-
[adLoader loadAd:self];
-
- Callback from APS
- On Success - (void)onSuccess:(DTBAdResponse*)adResponse;
- Pass the returned DTBAdResponse object to Aerserv iOS SDK without altering it.
-
ASInterstitialViewController* interVC = [ASInterstitialViewController viewControllerForPlacementID:plc withDelegate:self];
-
interVC.dtbAdResponses = @[dtbAdResponse];
-
- Response objects will include values inside of it similar to what is included in these sample responses (please refer to APS documentation and your APS Account Manager for any additional information):
- Video
-
{"ads":{"mVp0":{"b":"BID_ID","ps":"mVp0","kvp":{"dc":["pdx"]},"v":true,"sz":"100x100"}},"instrPixelURL":"https://aax-us-east.amazon-adsystem.com/x/px/","errorCode":"200","request_id":"0AAA0aaaAA00AaaAA0a0aa","status":"ok"}
-
- Banner
-
{"ads":{"o300x250p0":{"b":"BID_ID","kvp":{"amznp":["aaaaa0"],"dc":["pdx"]},"sz":"300x250","i":"https://aax-us-east.amazon-adsystem.com/e/msdk/imp?b=AAA&ps=o300x250p0"}},"instrPixelURL":"https://aax-us-east.amazon-adsystem.com/x/px/","errorCode":"200","request_id":"AaaaaaAaAAaAAaaa.AAAAa","status":"ok"}
-
- Video
- To receive the ad response, we'll need to implement the DTBAdCallback delegate protocol.
- Pass the returned DTBAdResponse object to Aerserv iOS SDK without altering it.
- On failure - (void)onFailure:(DTBAdError)error;
- No DTBAdResponse was given back
- On Success - (void)onSuccess:(DTBAdResponse*)adResponse;
- Init an ad size
4.3 AerServ SDK Downloads
AerServ Android SDK |
AerServ iOS SDK |
Comments