Ad Quality Additional Configuration
Customize your integration settings to get even more functionality using additional configurations.
Advanced Initialization
- User ID – Use your own user IDs for having meaningful user journey insights
- Test mode – Test your Ad Quality SDK integration (default is false)
- Log level – Choose a log level to debug code issues (default is INFO)
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();
User ID
The Ad Quality SDK provides two options for configuring your user IDs:
- 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.
- 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.
Test mode
adQualityConfig.TestMode = true;
// The default is false - set to true only to test your Ad Quality integration
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);
Initialization callbacks
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);
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.
ISAdQualityCustomMediationRevenue customMediationRevenue = new ISAdQualityCustomMediationRevenue();
customMediationRevenue.MediationNetwork = ISAdQualityMediationNetwork.SELF_MEDIATED;
customMediationRevenue.AdType = ISAdQualityAdType.REWARDED_VIDEO;
customMediationRevenue.Revenue = 1.2;
IronSourceAdQuality.SendCustomMediationRevenue(customMediationRevenue);
If you’re using AdMob mediation, follow these steps:
- Ask your AdMob account manager to enable AdMob impression-level LTV (iLTV)
- Verify that you use GMA SDK 8.12.0 or higher for Android or iOS and that the version supports iLTV
- 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);
}