Amazon Publisher Services integration guide

Before you start

Amazon Publisher Services (APS) is an invitation-only program that currently supports interstitial and banner/MREC ads. To integrate the APS, you will need to integrate and initialize both the ironSource SDK and APS SDK. Make sure you perform the full integration flow as detailed below to display APS ads in your application.

Step 1. Create an APS account

  1. Reach out to APS to set up your app’s account. To create an APS account, go to the APS website, click the “contact us” button, and open a request.
  2. If your APS request is approved, you will receive an invitation link to sign up and create your account with APS.
  3. The above steps must be completed before you proceed to set up APS in LevelPlay. 

Step 2. Set up your slots in APS Network

  1. Choose the right application from the apps menu and click on setup
  2. Choose ironSource LevelPlay as your monetization service setup menu
  3. Add slots and define for each slot :
    1. Name
    2. Ad size
    3. Price points (auto/manual)
  4. Finish adding all slots and pick up your credentials:
    1. Get your app id
    2. Download the price point CSV file

Step 3. Activate APS Network

Inside the ironSource platform, access the SDK Networks setup to configure APS parameters into your ironSource account.

  1. Once you have the credentials mentioned above, log in to your ironSource account and go to Monetize ➣ Setup SDK Networks
  2. Select APS from the table of Available Networks and click on the Activate button
  3. Select APS from the list of ad networks and click Setup.
  4. Enter your APS app ID and upload CSV file as is.

Step 4. Import the APS Unity plugin

  1. Download the APS Unity plugin from the APS website.
  2. Make sure your Unity project is opened and import the package.
  3. In the Unity menu bar, select Amazon, then Manage SDKs to open the Amazon SDK manager:

  4. Install the ironSource adapter, and import the unity package:

Unity Network Manager (Recommended)

Once you’ve completed SDK integration, add the APS Adapter using the Unity Network Manager.

In your Unity Development platform, go to Ads Mediation> Integration Manager

If you already have the latest version of the adapters, the action button will be changed to “Updated”, and will be disabled.

Step 6. Init APS SDK

The APS network requires that you initialize both the ironSource and APS SDKs to display APS ads. 

Initialize the APS SDK as soon as your application is opened and before initializing the ironSource SDK. Use the APS App ID defined in Step 2 of the APS setup.

Amazon.Initialize(amazonApiKey);

Step 7. Share APS Bid info with ironSource mediation per ad

Before loading each ad, call the APS API to get the load info that is required for ironSource SDK to load an ad.

These are the required steps: 

  1. Load the APS ad request before each ironSource ad unit load.  
  2. Call SetNetworkData to share the APS bid info with ironSource.
  3. Load the relevant ad unit using ironSource mediation APIs.

Load banner/MREC ads

  • Call the APS banner ad request before each ironSource ad unit load.
  • If the APS ad was loaded successfully, share the ad data with the LevelPlay mediation:
    1. This should include the following parameters:
      APS ironSource network key, Bid returned by Amazon, and slot unique identifier
    2. Load the banner by calling the loadBanner() method.
      private APSBannerAdRequest bannerAdRequest;
      bannerAdRequest = new APSBannerAdRequest(width, height, amazonBannerSlotId);
              bannerAdRequest.onFailedWithError += (adError) =>
              {
                  IronSource.Agent.loadBanner(IronSourceBannerSize.BANNER, IronSourceBannerPosition.BOTTOM);
              };
              bannerAdRequest.onSuccess += (adResponse) =>
              {
                   IronSource.Agent.setNetworkData(APSMediationUtils.APS_IRON_SOURCE_NETWORK_KEY,
                                                      APSMediationUtils.GetBannerNetworkData(amazonBannerSlotId, adResponse));
                   IronSource.Agent.loadBanner(IronSourceBannerSize.BANNER, IronSourceBannerPosition.BOTTOM);
              };
              bannerAdRequest.LoadAd();

      If APS returns no fill, call LevelPlay’s loadBanner().

      Banner refresh mechanism If you choose to use ironSource’s automatic refresh mechanism, make sure to call APS load ads after each impression.  This will ensure that the APS banners will be able to participate in the next auction, as well. If you do not want to maintain this logic, simply cancel the refresh mechanism and load each ad manually after destroying the previous ad.

      Load Interstitial ads  

      • Call APS interstitial ad request, before each ironSource ad-unit load. APS will either return a bid or return a no-fill.
      • If the APS ad was loaded successfully, share the ad data with the LevelPlay mediation:
        1. This should include the following parameters:
          APS ironSource network key, bid returned by Amazon, and slot unique identifier
        2. Load the interstitial by calling the loadInterstitial() method.
          private APSInterstitialAdRequest interstitialAdRequest;
          interstitialAdRequest = new APSInterstitialAdRequest(amzonInterstitialSlotId);
                  interstitialAdRequest.onSuccess += (adResponse) =>
                  {
                 IronSource.Agent.setNetworkData(APSMediationUtils.APS_IRON_SOURCE_NETWORK_KEY
          ,APSMediationUtils.GetInterstitialNetworkData(amzonInterstitialSlotId, adResponse));
                      IronSource.Agent.loadInterstitial();
                  };
                  interstitialAdRequest.onFailedWithError += (adError) =>
                  {
                      IronSource.Agent.loadInterstitial();
                      Debug.Log("onFailedWithError interstitial:" + adError);
                  };
                  interstitialAdRequest.LoadAd();

      If APS returns no fill, call LevelPlay’s loadInterstitial().

      ironSource supports APS interstitial video ads, starting from APS adapter 4.3.2. To load an interstitial video, create APS AdRequest:

      private APSVideoAdRequest interstitialVideoAdRequest;
      interstitialVideoAdRequest = new APSVideoAdRequest(320, 480, amazonInterstitialVideoSlotId);
          interstitialVideoAdRequest.onSuccess += (adResponse) =>
          {
              IronSource.Agent.setNetworkData(APSMediationUtils.APS_IRON_SOURCE_NETWORK_KEY,
                                                  APSMediationUtils.GetInterstitialNetworkData(amazonInterstitialVideoSlotId, adResponse));
              IronSource.Agent.loadInterstitial();
          };
          interstitialVideoAdRequest.onFailedWithError += (adError) =>
          {
              IronSource.Agent.loadInterstitial();
          };
          interstitialVideoAdRequest.LoadAd();
      }

      Rewarded Video ads

      The APS integration differs according to the Rewarded Video operation mode that you implement in your app. 

      1. Manual loading mode: This is the recommended setup to integrate with APS. . This will require you to call APS ad requests before each rewarded video load.
      2. Rewarded video default mode (automatic): When using the LevelPlay default mode for displaying rewarded videos, you’ll need to load the first APS ad, before initializing the ironSource SDK, and after initializing the APS SDK. In addition, we recommend calling the next APS load request before each show, to affect the next waterfall request.

      Load Rewarded Video ads

      1. Call the APS rewarded video ad request before each ironSource ad unit load (or before the show, in automatic mode). Use the Slot UUID when creating the load ad request.
      2. If the APS ad was loaded successfully, share the following ad data with the LevelPlay mediation:
        • APS ironSource network key, bid returned by Amazon, and slot unique identifier
      3. If APS returns no fill, the onFailedWithError() callback will be triggered.
        public void RequestRewardedVideo()
        {
            rewardedVideoAdRequest = new APSVideoAdRequest(320, 480, amazonRewardedVideoSlotId);
            rewardedVideoAdRequest.onSuccess += (adResponse) =>
            {
                IronSource.Agent.setNetworkData(APSMediationUtils.APS_IRON_SOURCE_NETWORK_KEY,
                                                    APSMediationUtils.GetRewardedNetworkData(amazonRewardedVideoSlotId, adResponse));
                IronSource.Agent.loadRewardedVideo(); // If manual rewarded mode
            };
            interstitialVideoAdRequest.onFailedWithError += (adError) =>
            {
                IronSource.Agent.loadRewardedVideo(); // If manual rewarded mode
            };
            rewardedAdRequest.LoadAd();
        }

      Done!

      You’re now ready to deliver APS demand within your application.


      What’s Next?
      To leverage additional ad networks through LevelPlay, integrate the network adapters and follow our integration guides.