The Ad Quality SDK enables the Ad Quality solution to run in your app. It automatically collects all ad events and attributes needed from the ad network SDKs you currently use, which simplifies the integration and requires minimal coding.
Before you integrate the SDK, make sure you’ve added at least one app to your account.
Step 1: Import the Ad Quality SDK to your app
Gradle
Build.gradle
repositories {
maven {
url 'https://android-sdk.is.com/'
}
}
dependencies {
// ironSource Ad Quality SDK
implementation 'com.ironsource:adqualitysdk'
}
Step 2: Initialize the SDK
To initialize the SDK you’ll need your app key, which can be found in the Ad Quality dashboard under Settings.
The Ad Quality SDK should be initialized on your app’s main thread, or on the same thread as your other ad network SDKs.
Add the following code to your app’s main activity:
import com.ironsource.adqualitysdk.sdk.IronSourceAdQuality;
protected void onCreate(Bundle savedInstanceState) {
// Get the Ad Quality appKey from the App's Settings page.
String adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
// Initialize
IronSourceAdQuality.getInstance().initialize(activity, adQualityAppKey);
}
Step 3: Advanced SDK Initialization
Use a special configuration to customize your integration settings further and get even more functionality:
- User ID - Use your own user IDs, instead of the default IDs from Ad Quality
- Test mode - Test your Ad Quality SDK integration (default is false)
- Log level - Choose a log level to debug code issues (default is INFO)
To initialize the Ad Quality SDK with a special configuration, complete the initialization function with a config object.
Use the code below to create your config object with a builder.
Note: None of the following attributes are mandatory.
ISAdQualityConfig.Builder adQualityConfigBuilder = new ISAdQualityConfig.Builder();
adQualityConfigBuilder.setUserId(userId);
// The default user id is Ad Quality internal id.
// The only allowed characters for user id are: letters, numbers, @, -, :, =, _ and /.
// The user id cannot be null and must be between 2 and 100 characters, otherwise it will be blocked.
adQualityConfigBuilder.setTestMode(true);
// The default is false - set to true only to test your Ad Quality integration
adQualityConfigBuilder.setLogLevel(ISAdQualityLogLevel.INFO);
// There are 5 different log levels:
// ERROR, WARNING, INFO, DEBUG, VERBOSE
// The default is INFO
// Get the Ad Quality appKey from the App's Settings page.
String adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
ISAdQualityConfig adQualityConfig = adQualityConfigBuilder.build();
IronSourceAdQuality.getInstance().initialize(activity, adQualityAppKey, adQualityConfig);
Configure your user IDs
You’ll need a user’s ID to use the user journey tab, and see the ad flow for a specific user. Using your existing user IDs will streamline the way you manage users across platforms.
If you initialize the Ad Quality SDK without your user IDs, Ad Quality will set default user IDs.
The Ad Quality SDK provides 2 options for configuring your user IDs:
1. Use your own user IDs, and add them before or during initialization:
adQualityConfigBuilder.setUserId(userId);
2. Change the default user IDs after initializing the Ad Quality SDK:
IronSourceAdQuality.getInstance().changeUserId(userId);
Step 4: Configure SDK callback events
ISAdQualityInitListener:
ISAdQualityConfig.Builder builder = new ISAdQualityConfig.Builder().setAdQualityInitListener(new ISAdQualityInitListener() {
@Override
public void adQualitySdkInitSuccess() {
Log.d("AdQualityInitListener", "adQualitySdkInitSuccess");
}
@Override
public void adQualitySdkInitFailed(ISAdQualityInitError error, String message) {
Log.d("AdQualityInitListener", "adQualitySdkInitFailed " + error + " message: " + message);
}
});
// Get the Ad Quality appKey from the App's Settings page.
String adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
ISAdQualityConfig adQualityConfig = builder.build();
IronSourceAdQuality.getInstance().initialize(activity, adQualityAppKey, adQualityConfig);
Note: It usually takes 3-4 seconds to initialize the Ad Quality SDK, depending on the number of ad network SDKs integrated into your app. Network connectivity issues may also cause delays.
Step 5 (optional): Managing GDPR consent
Ad Quality SDK supports publisher communication of a user’s consent choice.
To update a user's consent status using the Ad Quality API, use the following function.
If the user-provided consent, set the flag to true.
IronSourceAdQuality.getInstance().setUserConsent(true);
The Ad Quality SDK enables the Ad Quality solution to run in your app. It automatically collects all ad events and attributes needed from the ad network SDKs you currently use, which simplifies the integration and requires minimal coding.
Before you integrate the SDK, make sure you’ve added at least one app to your account.
Step 1: Import the Ad Quality SDK to your app
Cocoapods
Podfile
## ironSource Ad Quality SDK
pod 'IronSourceAdQualitySDK'
Step 2: Initialize the SDK
To initialize the SDK you’ll need your app key, which can be found in the Ad Quality dashboard under Settings.
The Ad Quality SDK should be initialized on your app’s main thread, or on the same thread as your other ad network SDKs.
Add the following code to the viewDidLoad method of your main ViewController:
#import "IronSourceAdQuality.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Get Ad Quality appKey from the App's Settings page.
NSString *adQualityAppKey = @"<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
// Initialize
[[IronSourceAdQuality getInstance] initializeWithAppKey:adQualityAppKey];
}
@end
Step 3: Advanced SDK Initialization
Use a special configuration to customize your integration settings further and get even more functionality:
- User ID - Use your own user IDs, instead of the default IDs from Ad Quality
- Test mode - Test your Ad Quality SDK integration (default is false)
- Log level - Choose a log level to debug code issues (default is INFO)
To initialize the Ad Quality SDK with a special configuration, complete the initialization function with a config object.
Use the code below to create your config object with a builder.
Note: None of the following attributes are mandatory.
ISAdQualityConfig *adQualityConfig = [ISAdQualityConfig config];
adQualityConfig.userId = userId;
// The default user id is Ad Quality internal id.
// The only allowed characters for user id are: letters, numbers, @, -, :, =, _ and /.
// The user id cannot be null and must be between 2 and 100 characters, otherwise it will be blocked.
adQualityConfig.testMode = YES;
// The default is NO - set to true only to test your Ad Quality integration
adQualityConfig.logLevel = IS_AD_QUALITY_LOG_LEVEL_INFO;
// There are 5 different log levels:
// IS_AD_QUALITY_LOG_LEVEL_ERROR,
// IS_AD_QUALITY_LOG_LEVEL_WARNING,
// IS_AD_QUALITY_LOG_LEVEL_INFO,
// IS_AD_QUALITY_LOG_LEVEL_DEBUG,
// IS_AD_QUALITY_LOG_LEVEL_VERBOSE
// The default is IS_AD_QUALITY_LOG_LEVEL_INFO
// Get Ad Quality appKey from the App's Settings page.
NSString *adQualityAppKey = @"<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
[[IronSourceAdQuality getInstance] initializeWithAppKey:adQualityAppKey andConfig:adQualityConfig];
Configure your user IDs
You’ll need a user’s ID to use the user journey tab, and see the ad flow for a specific user. Using your existing user IDs will streamline the way you manage users across platforms.
If you initialize the Ad Quality SDK without your user IDs, Ad Quality will set default user IDs.
The Ad Quality SDK provides 2 options for configuring your user IDs:
1. Use your own user IDs, and add them before or during initialization:
[adQualityConfig setUserId:userId];
2. Change the default user IDs after initializing the Ad Quality SDK:
[[IronSourceAdQuality getInstance] changeUserId:userId];
Step 4: Configure SDK callback events
iOS callbacks should be implemented in a separate class, in the same place where the Ad Quality SDK was initialized.
ISAdQualityInitDelegate:
#import "IronSourceAdQuality.h"
@interface ViewController () : NSObject<ISAdQualityInitDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
ISAdQualityConfig *config = [ISAdQualityConfig config];
[config setISAdQualityInitDelegate:self];
// Get Ad Quality appKey from the App's Settings page.
NSString *adQualityAppKey = @"<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
// Initialize
[[IronSourceAdQuality getInstance] initializeWithAppKey:adQualityAppKey
andConfig:config];
}
- (void)adQualitySdkInitSuccess {
NSLog(@"adQualitySdkInitSuccess");
}
- (void)adQualitySdkInitFailed:(ISAdQualityInitError) error withMessage:(NSString *)message {
NSLog(@"adQualitySdkInitFailed %u message: %@", error, message);
}
Note: It usually takes 3-4 seconds to initialize the Ad Quality SDK, depending on the number of ad network SDKs integrated into your app. Network connectivity issues may also cause delays.
Step 5 (optional): Managing GDPR consent
Ad Quality SDK supports publisher communication of a user’s consent choice.
To update a user's consent status using the Ad Quality API, use the following function.
If the user-provided consent, set the flag to true.
[[IronSourceAdQuality getInstance] setUserConsent:true];
The Ad Quality SDK enables the Ad Quality solution to run in your app. It automatically collects all ad events and attributes needed from the ad network SDKs you currently use, which simplifies the integration and requires minimal coding.
Before you integrate the SDK, make sure you’ve added at least one app to your account.
Step 1: Import the Ad Quality SDK to your app
- To add the Unity3D Package to your project, please use the following download link:
- Make sure your Unity3D project is opened and import the Unity3D package.
- Double-click on the extracted file. The different files will be populated automatically as shown below:
Go to: Assets → External Dependency Manager → Android Resolver → Resolve
This will download all relevant artifacts, according to your choices.
Go to: Assets → External Dependency Manager → Android Resolver → Resolve
Step 2: Initialize the SDK
To initialize the SDK you’ll need your app key, which can be found in the Ad Quality dashboard under Settings.
The Ad Quality SDK should be initialized on your app’s main thread, or on the same thread as your other ad network SDKs.
Add the following code to the Awake method of your first scene:
void Awake ()
{
// Get Ad Quality appKey from the App's Settings page.
string adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
// Initialize
IronSourceAdQuality.Initialize(adQualityAppKey);
}
Step 3: Advanced SDK Initialization
Use a special configuration to customize your integration settings further and get even more functionality:
- User ID - Use your own user IDs, instead of the default IDs from Ad Quality
- Test mode - Test your Ad Quality SDK integration (default is false)
- Log level - Choose a log level to debug code issues (default is INFO)
To initialize the Ad Quality SDK with a special configuration, complete the initialization function with a config object.
Use the code below to create your config object with a builder.
Note: None of the following attributes are mandatory.
Add the following code in the Awake method of your first scene:
void Awake ()
{
ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
adQualityConfig.UserId = userId;
// The default user id is Ad Quality internal id.
// The only allowed characters for user id are: letters, numbers, @, -, :, =,_ and /.
// The user id cannot be null and must be between 2 and 100 characters, otherwise it will be blocked.
adQualityConfig.TestMode = true;
// The default is false - set to true only to test your Ad Quality integration
adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
// There are 5 different log levels:
// ERROR, WARNING, INFO, DEBUG, VERBOSE
// The default is INFO
// Get Ad Quality appKey from the App's Settings page.
string adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
IronSourceAdQuality.Initialize(adQualityAppKey, adQualityConfig);
}
Configure your user IDs
You’ll need a user’s ID to use the user journey tab, and see the ad flow for a specific user. Using your existing user IDs will streamline the way you manage users across platforms.
If you initialize the Ad Quality SDK without your user IDs, Ad Quality will set default user IDs.
The Ad Quality SDK provides 2 options for configuring your user IDs:
1. Use your own user IDs, and add them before or during initialization:
AdQualityConfig.UserId = userId;
2. Change the default user IDs after initializing the Ad Quality SDK:
IronSourceAdQuality.ChangeUserId(userId);
Step 4: Configure SDK callback events
Unity3d 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
};
// Get Ad Quality appKey from the App's Settings page.
string adQualityAppKey = "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>";
IronSourceAdQuality.Initialize(adQualityAppKey, adQualityConfig);
Note: It usually takes 3-4 seconds to initialize the Ad Quality SDK, depending on the number of ad network SDKs integrated into your app. Network connectivity issues may also cause delays.
Step 5 (optional): Managing GDPR consent
Ad Quality SDK supports publisher communication of a user’s consent choice.
To update a user's consent status using the Ad Quality API, use the following function.
If the user-provided consent, set the flag to true.
IronSourceAdQuality.SetUserConsent(true):