Interstitial Integration for Android

The Unity LevelPlay Mediation now supports Interstitials, the industry’s most popular ad format! The Interstitial Mediation solution is easy and simple to integrate within the ironSource SDK and optimizes user experience, fill rate and eCPM.

Serve Interstitial Ads through our Interstitial Mediation in 5 easy steps:

  1. Implement the Listener
  2. Initialize the Interstitial
  3. Load Interstitial Ad
  4. Check Ad Availability
  5. Show Interstitial Ad

Before You Start

Make sure that you have correctly integrated the ironSource SDK into your application. Integration is outlined here.

Step 1. Implement the Listener

The SDK will callback the events registered to your Listener object in order to inform you of the ad availability. The SDK will notify your Listener of all possible events listed below:

//Import the Interstitial Listener
import com.supersonic.mediationsdk.sdk.InterstitialListener;
InterstitialListener mInterstitialListener = new InterstitialListener()
{
/**
 * Invoked when Interstitial initialization process completes successfully.
 */
public void onInterstitialInitSuccess(){}
/**
 * Invoked when Interstitial initialization process is failed.
 * @param supersonicError - An Object which represents the reason of initialization failure.
 */
public void onInterstitialInitFailed(SupersonicError supersonicError){}
/**
Invoked when Interstitial Ad is ready to be shown after load function was called.
*/
public void onInterstitialReady(){}
/**
invoked when there is no Interstitial Ad available after calling load function.
*/
public void onInterstitialLoadFailed(SupersonicError supersonicError){}
/*
 * Invoked when the ad was opened and shown successfully.
 */
public void onInterstitialShowSuccess(){}
/**
 * Invoked when Interstitial ad failed to show.
 * @param supersonicError - An object which represents the reason of showInterstitial failure.
 */
public void onInterstitialShowFailed(SupersonicError supersonicError){}
/*
 * Invoked when the end user clicked on the interstitial ad.
 */
public void onInterstitialClick(){}
/*
 * Invoked when the ad is closed and the user is about to return to the application.
 */
public void onInterstitialClose(){}
/**
Invoked when the Interstitial Ad Unit is opened
*/
public void onInterstitialOpen(){}
};
Note: Note:
  • The onInterstitialOpen event conveys the ad format has takes over the app screen but does not indicate that an ad has been successfully served to your end-user.
  • The onInterstitialShowSuccess event conveys an Interstitial Ad from ironSource or any other ad network was successfully served to your end-user.
Do not assume the callbacks are always running on the main thread. Any UI interaction or updates resulting from ironSource callbacks need to be passed to the main thread before executing.

Step 2. Initialize the Interstitial Unit

You should initialize the Interstitial Ad Unit as early as possible to allow time for the Interstitial to load. We recommend doing so on app launch.

public class YourActivity extends Activity
{
  //Declare the Supersonic Mediation Agent
  private Supersonic mMediationAgent;
  public void onCreate(Bundle savedInstanceState) 
  {
    super.onCreate(savedInstanceState);
    //Get the mediation publisher instance 
    mMediationAgent = SupersonicFactory.getInstance();
    //Set the Interstitial Listener
    mMediationAgent.setInterstitialListener(mInterstitialListener);
    //Set the unique id of your end user.
    String mUserId = "APPLICATION_USER_ID_HERE"; 
    //Set the Application Key - can be retrieved from Supersonic platform
    String mAppKey = "APPLICATION_APP_KEY_HERE";
    //Init Interstitial
    mMediationAgent.initInterstitial(this, mAppKey, mUserId);
  }
}
Note: Note:
  1. “this” is the activity in which the Ad Unit should be presented.
  2. mAppKey is the unique ID of your Application in your ironSource account.
    ironsource-platform-app-key
  3. mUserId is the unique ID of your end user. We support NSString from 1 to 64 characters. Common practice is to use the Apple Advertising ID (IDFA). More information on User IDs can be found here.
    Important! You must enter a unique user ID for each individual user.  Neglecting this field will cause a significant decrease in fill rate and ad performance for your app. Find more information on User IDs and how to generate them here.

Step 3. Load Interstitial Ad

We recommend requesting an Interstitial Ad a short while before you plan on showing it to your users as the loading process can take time. Before calling the load method, make sure you receive onInterstitialInitSuccess first.

To request an interstitial ad, call the following method:

 mMediationAgent.loadInterstitial();

Note:  Note: If you’d like to serve several Interstitial Ads in your application, you must repeat this step after you’ve shown and closed the previous Interstitial Ad. Once the onInterstitialClose function is fired, you will be able to load a new Interstitial ad.

Step 4. Check Ad Availability

After you have received the onInterstitialInitSuccess() callback and you’ve called the loadInterstitial in Step 3, you will be notified when the ad is loaded and ready to be shown to your user. The onInterstitialReady() will inform you about ad availability.

public void onInterstitialReady(){}

Alternatively, you can ask for the ad availability directly by calling the following function:

 boolean isInterstitialReady();

Once the Interstitial ad is available you will be able to show the ad to your users. With Unity LevelPlay Ad Placements, you can customize and optimize the Interstitial experience. This tool enables you to present Interstitial ads to your users in different places, i.e. app launch, between levels, etc. You can use the function in the next step to define the exact Placement you’d like to show an ad from. In addition, to receive details about a specific Ad Placement, you can call the following:

getInterstitialPlacementInfo()

In addition to Unity LevelPlay Ad Placements, you can now configure capping and pacing settings for selected placements. Capping and pacing improves the user experience in your app by limiting the amount of ads served within a defined timeframe.

Navigate to the Ad Placement document for more details.

Step 5. Show Interstitial Ad

Once you receive the onInterstitialReady callback, you are ready to show an Interstitial Ad to your users. Invoke the following method on your Supersonic Instance to serve an Interstitial ad to your users.

mMediationAgent.showInterstitial(placementName);

Important! Once you’ve successfully completed step 5, you will have shown your user an Interstitial Ad. In the case you want to serve another Interstitial ad, you must repeat Step 3 to request an additional Interstitial.
 

First Time Integration Tip

If this is a new integration for your application, your app will by default be in ‘Test Mode‘ on your ironSource dashboard. While your app is in Test Mode, the ironSource SDK will print more logs to the console in order to provide greater visibility into the SDK processes. To test your ad inventory, set up your Test Devices. Until you turn on live ad inventory, you will receive test campaigns that don’t generate revenue. Make sure to select Go Live! on the Ad Units page when your app is ready for live ad inventory.

ironsource-go-live-with-rewarded-video

Done!
You can now deliver Unity LevelPlay Interstitial Ads through the Interstitial Mediation platform!


What’s Next?
Follow our integration guides to integrate additional Interstitial Ad networks or configure additional Ad Units: