Follow

How to Set Up Amazon Publisher Services (APS) as an Ad Source

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

https://a9.com/

       
 GUIDELINES
  • The APS SDK must be bundled separately from the AerServ SDK. The APS SDK will need to be called prior to making the ad request to AerServ in order to pass in the bid object.
  • If a bid object is not passed through prior to the AerServ ad request, APS will not be included in the auction.
  • If a bid object is passed where the price point does not correspond to any set up on the AerServ platform, APS will not participate in the auction.
  • If multiple bids are returned with the same bid id prior to one ad request, only the first one sent will be used.
  • The ad will be rendered and displayed by the AerServ SDK and not the APS SDK

 

 

Table of Contents

  

   

1. How AerServ + APS Works

AS-APS.gif

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:

Screen_Shot_2018-07-23_at_11.56.59_AM.png

 

"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.
The number listed after the colon is the price paid for the ad. Enter this number in the CPM field for the ad source. APS will not return the colon and price in the "amznslots" value of their bid response.

 

 

3. Setting Up the APS Ad Source in AerServ

 

3.1 Creating a New Ad Source

 

 
Note: You will need to set up an ad source for every pricepoint set up in your APS account. If a price point is passed and does not match up with the price point assigned to any ad source set up on the AerServ platform, APS will not participate in the auction.

 

Log in  >  Ad Sources Tab  >  Ad Networks Sub Nav  >  + New Ad Source Button

 

SMF8WyjW76.gif

 

 
Important Note About Banner Refresh: When you set up an APS ad source for a placement, banner refresh will be disabled for that placement and we will require you to request an ad each time to make sure APS always participates in the auction.

 

 

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.

 

 
Please note: The sample steps to call the APS SDK below are only examples, please refer to the APS SDK documentation or your APS account manager to confirm your setup is correct or if you have any issues. AerServ is not able to assist with your APS SDK integration.

 

  1. Make sure that whichever class is calling the APS SDK is a delegate of DTBAdCallback
  2. 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.*;
  3. 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
  4. How to request an ad from APS SDK
    1. 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";
          
    2. Call loadAd from the ad loader
      • adLoader.loadAd(new DTBAdCallback(){//override callback methods (onSuccess and onFailure) here
        });
    3. Callback from APS
      1. On Success public void onSuccess(DTBAdResponse dtbAdResponse)
        1. 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)
        2. 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):
          1. Video
          2. {"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"}
          3. Banner
          4. {"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"}
      2. On failure public void onFailure(AdError adError)
        1. No DTBAdResponse was given back

 

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.

 

 
Please note: The sample steps to call the APS SDK below are only examples, please refer to the APS SDK documentation or your APS account manager to confirm your setup is correct or if you have any issues. AerServ is not able to assist with your APS SDK integration.

 

  1. Make sure that whichever class is calling the APS SDK is a delegate of DTBAdCallback
  2. 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)
  3. 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
  4. How to request an ad from APS SDK
    1. Init an ad size
      1. Interstitial video
        1. DTBAdSize *interstitialSize = [[DTBAdSize alloc] initVideoAdSizeWithPlayerWidth:wd height:ht andSlotUUID:slotUUID];
      2. Interstitial
        1. DTBAdSize *interstitialSize = [[DTBAdSize alloc] initInterstitialAdSizeWithSlotUUID:slotUUID];
      3. Banner
        1. DTBAdSize *bannerSize = [[DTBAdSize alloc] initBannerAdSizeWithWidth:wd height:ht andSlotUUID:slotUUID];
    2. 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";
          
    3. Call loadAd from the ad loader
      1. [adLoader loadAd:self];
    4. Callback from APS
      1. On Success - (void)onSuccess:(DTBAdResponse*)adResponse;
        1. Pass the returned DTBAdResponse object to Aerserv iOS SDK without altering it.
          1. ASInterstitialViewController* interVC = [ASInterstitialViewController viewControllerForPlacementID:plc withDelegate:self];
          2. interVC.dtbAdResponses = @[dtbAdResponse];
        2. 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):
          1. Video
            1. {"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"}
          2. Banner
            1. {"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"}
        3.  To receive the ad response, we'll need to implement the DTBAdCallback delegate protocol.
      2. On failure - (void)onFailure:(DTBAdError)error;
        1. No DTBAdResponse was given back

 

4.3 AerServ SDK Downloads

 

AerServ Android SDK

AerServ iOS SDK

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments