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 the following 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
If you're using LevelPlay make sure you've init Ad Quality first to use the following functionalities
public class AdQualityInit : ISAdQualityInitCallback { public void adQualitySdkInitSuccess() { Debug.Log("adQualitySdkInitSuccess"); } public void adQualitySdkInitFailed(ISAdQualityInitError adQualitySdkInitError, string errorMessage) { Debug.Log($"adQualitySdkInitFailed: {adQualitySdkInitError}, message: {errorMessage}"); } } public class AdQualityDemo : MonoBehaviour { void Awake() { AdQualityInit initCallbacks = new AdQualityInit(); ISAdQualityConfig adQualityConfig = new ISAdQualityConfig { AdQualityInitCallback = initCallbacks }; 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 following code snippet 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); }