Ad Quality Additional Configuration

Customize your integration settings to get even more functionality using additional configurations.

Advanced Initialization 

  1. User ID – Use your own user IDs for having meaningful user journey insights
  2. Test mode – Test your Ad Quality SDK integration (default is false)
  3. Log level – Choose a log level to debug code issues (default is INFO)

Note: Make sure you’ve initialized the Ad Quality SDK first to use the following functionalities.

Use the code below to create your config object with a builder.

Add the following code in the Awake method of your first scene:

ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
  • Light theme
  • Dark theme
  • Copy to clipboard

User ID

The Ad Quality SDK provides two options for configuring your user IDs:

  1. Use your own user IDs, add them at any time – prior to ad quality initialization:
    adQualityConfig.UserId = userId;
    // The default user id is Ad Quality internal id.
    // The user id cannot be null and must be between 2 and 100 characters, otherwise it will be blocked.
    • Light theme
    • Dark theme
    • Copy to clipboard

  2. For cases where your user id is resolved after AdQuality initialization, we’ve provided an API to modify the default user ID:
    IronSourceAdQuality.ChangeUserId(userId);
    // The default user id is Ad Quality internal id. 
    // The user id cannot be null and must be between 2 and 100
    characters, otherwise it will be blocked.
    • Light theme
    • Dark theme
    • Copy to clipboard

Test mode

adQualityConfig.TestMode = true;
// The default is false - set to true only to test your Ad Quality integration
  • Light theme
  • Dark theme
  • Copy to clipboard

Log level

adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
// There are 5 different log levels:
// ERROR, WARNING, INFO, DEBUG, VERBOSE
// The default is INFO
IronSourceAdQuality.Initialize(appKey, adQualityConfig);
  • Light theme
  • Dark theme
  • Copy to clipboard

Initialization callbacks

Note: If you’re using LevelPlay make sure you’ve init Ad Quality first to use the following functionalities 

Your callbacks should be implemented in a separate class, in the same place where the Ad Quality SDK was initialized.

public class AdQualitySdkInit: ISAdQualityInitCallback {
   public void adQualitySdkInitSuccess() {
       Debug.Log("unity: adQualitySdkInitSuccess");
   }
   public void adQualitySdkInitFailed(ISAdQualityInitError adQualitySdkInitError, string errorMessage) {
       Debug.Log("unity: adQualitySdkInitFailed " + adQualitySdkInitError + " message: " + errorMessage);
   }
}
AdQualitySdkInit adQualitySdkInit = new AdQualitySdkInit();
ISAdQualityConfig adQualityConfig = new ISAdQualityConfig {
   AdQualityInitCallback = adQualitySdkInit
};
IronSourceAdQuality.Initialize(appKey, adQualityConfig);
  • Light theme
  • Dark theme
  • Copy to clipboard

Note: The time it takes to initialize the Ad Quality SDK depends on the number of ad network SDKs integrated into your app. Network connectivity issues may also cause delays. On average, initializations take between 3 – 4 seconds.

Report impression-level ad revenue to Ad Quality SDK

  • If you’re using LevelPlay make sure you’ve initialized the Ad Quality SDK first to use the following functionalities
  • This feature supports interstitial and rewarded ads only. 
  • For LevelPlay, MAX, and DT FairBid this data collected automatically
  • Minimum requirement: Ad Quality SDK 7.2.0+

To report Impression-level ad revenue in the Ad Quality SDK, add the code snippet below to your SDK integration.

Important!  sendCustomMediationRevenue method should be called when the ad displayed, calling it out of ad lifecycle have no affect.

ISAdQualityCustomMediationRevenue customMediationRevenue = new ISAdQualityCustomMediationRevenue();
customMediationRevenue.MediationNetwork = ISAdQualityMediationNetwork.SELF_MEDIATED;
customMediationRevenue.AdType = ISAdQualityAdType.REWARDED_VIDEO;
customMediationRevenue.Revenue = 1.2;
IronSourceAdQuality.SendCustomMediationRevenue(customMediationRevenue);
  • Light theme
  • Dark theme
  • Copy to clipboard

If you’re using AdMob mediation, follow these steps:

  1. Ask your AdMob account manager to enable AdMob impression-level LTV (iLTV)
  2. Verify that you use GMA SDK 8.12.0 or higher for Android or iOS and that the version supports iLTV
  3. Add the following code snippet to your Ad Quality SDK integration:
RewardedAd rewardedAd;
public void HandleRewardedAdLoaded(object sender, EventArgs args)
{
    this.rewardedAd = args.rewardedAd;
}
private void HandleAdPaidEvent(object sender, AdValueEventArgs args)
{
   AdValue impressionData = args.AdValue;
   ISAdQualityCustomMediationRevenue customMediationRevenue = new ISAdQualityCustomMediationRevenue();
   customMediationRevenue.MediationNetwork = ISAdQualityMediationNetwork.ADMOB;
   customMediationRevenue.AdType = ISAdQualityAdType.REWARDED_VIDEO;
   customMediationRevenue.Revenue = impressionData.Value/1000000f;
   IronSourceAdQuality.SendCustomMediationRevenue(customMediationRevenue);
}
  • Light theme
  • Dark theme
  • Copy to clipboard