Advanced Settings

GDPR – Managing Consent

ironSource’s mediation platform supports publisher communication of a user’s consent choice to mediated networks (for supported networks).

To use ironSource’s API to update a user’s consent status, use this functions:

If the user provided consent, please set the following flag to true:

 [IronSource setConsent:YES];

If the user did not consent, please set the following flag to false:

 [IronSource setConsent:NO];

It’s recommended to set the API prior to SDK Initialization.

A detailed article regarding ironSource’s approach to GDPR and user consent can be found here.

CCPA Compliance

ironSource’s mediation platform (SDK Version 6.14.0 and above) supports publishers to restrict the sale of end users personal information under the California Consumer Privacy Act (CCPA).

The notification about personal information of specific users located in California should be handled based on a “do not sell” setting, by setting its value to “true” or “false”.

The API should be set before initializing the SDK.

If the user has opted out of “sale” of personal information:

 [IronSource setMetaDataWithKey:@"do_not_sell" value:@"YES"];

If “sale” of personal information is permitted:

 [IronSource setMetaDataWithKey:@"do_not_sell" value:@"NO"];

A detailed article regarding ironSource’s approach to CCPA can be found here.

Set UserID

If you’re serving the Offerwall ad unit or using server-to-server callbacks to reward your users with our rewarded ad units, you must set the UserID.

The userID is a unique identifier for each of your users. You can set the userID parameter, or omit it and let us generate one for you. If you choose to skip setting the userID in your code, the SDK will generate an equitable userID. userID string should not exceed 62 characters.
More information on User IDs can be found here.

Note: In the case you want to define the userID manually, you must do this before the init request. You cannot define the userID after the init request. 
[IronSource setUserId:YOUR_USERID];
IronSource.setUserId(userID)

Define Segments

You can now easily tailor the way you serve your ads to fit a specific audience! You’ll need to inform our servers of the users’ details so the SDK will know to serve ads according to the segment the user belongs to.

ironSource supports three methods to convey data to our servers to outline the user segment, namely:

  • Device Properties: the ironSource SDK collects certain standard parameters that pertain to the users’ device automatically such as location, device model, device manufacturer, app version, OS, etc. You do not need to convey this data to us.
  • User Properties: comprehensive user data such as age, gender, creation date, etc. (see full list of supported segment properties with descriptions below) must be relayed through the API. Follow the instructions to send us your user’s details so our SDK can categorize your different users based on the segments you defined on the ironSource platform.
  • Custom Segments: you can create a custom segment with predefined conditions without conveying user details to our servers and tailor ad settings for that user segment on the ironSource platform.

Pass User Properties

Once you’ve defined segments on the ironSource platform, you should inform our servers of the user’s particulars.

Segments must be set before initializing the SDK.

First, init the segment:

ISSegment *segment = [[ISSegment alloc]init];
let segment: ISSegment = ISSegment()

Define what properties to send to our servers on which to base the segments. You can transmit this information through one of the following methods:

  1. If you are familiar with the segment that the user belongs to, enter the segment name:
    [segment setSegmentName:YOUR_SEGMENT_NAME];
    segment.segmentName = "YOUR_SEGMENT_NAME"
  2. Send us the user details. ironSource provides a range of standard user properties that you can set to attribute a user to a segment in the API. See table below for descriptions.
    // Set user age
    [segment setAge:USER_AGE]; 
    // Set user gender
    [segment setGender:USER_GENDER];
    // Set user level
    [segment setLevel:USER_LEVEL];
    // Set user's paying status
    [segment setPaying:USER_PAYING];
    // Set user's total in-app purchase history
    [segment setIapTotal:YOUR_IAP_TOTAL];
    // Set user creation date
    [segment setUserCreationDate:YOUR_DATE];
    // Set user age
    segment.age = USER_AGE
    // Set user gender
    segment.gender = ISGender.IRONSOURCE_USER_FEMALE
    // Set user's total in-app purchases
    segment.iapTotal = USER_IAP_TOTAL
    // Set user's level
    segment.level = USER_LEVEL
    // Set user's paying status
    segment.paying = USER_PAYING_STATUS
    // Set user creation date
    segment.userCreationDate = NSDate() as Date!

    In addition, you can set up to 5 custom user properties per segment:

    [segment setCustomValue:YOUR_CUSTOM_VALUE forKey:YOUR_CUSTOM_KEY];
    segment.setCustomValue("CUSTOM_VALUE", forKey: "CUSTOM_KEY")

    Next, to serve your ad units based on segments to tailor the user’s ad experience, call the following function complete with either the segment name or user properties:

    [IronSource setSegment:YOUR_SEGMENT];
    IronSource.setSegment(YOUR_SEGMENT);

Supported Segment Properties

Segment Properties Type Limitation Description
segmentName String
  • alphanumeric
  • up to 32 letters
The given name of the segment in your ironSource account
Age Int 1-99 The user’s age
Gender enum IRONSOURCE_USER_MALE or IRONSOURCE_USER_FEMALE The user’s gender
Paying Boolean True or False
  • True if the user has spent any money on in-app purchases
  • False if the user has not spent any money on in-app purchases
iap_total Double 1-999999.99 The total amount of money that the user has spent on in-app purchases
userCreationDate NSDate Cannot be smaller than 0 The date the user installed the app
Custom Parameters key=string, value=string
  • ironSource supports up to 5 custom parameters
  • alphanumeric
  • up to 32 letters
Any additional data you’d like to dispatch to our server

Obtain the User’s Segment Name

  1. Adopt this interface in your class to conform to the Segment Name protocol and enable the receipt of the segment name ISSegmentDelegate
  2. Register to the following delegate to receive the segment name that your user belongs to. The SDK will then notify your delegate of the event.
    [IronSource setSegmentDelegate:self];
    IronSource.setSegmentDelegate(self)
  3. (void)didReceiveSegement:(NSString *)segment
    func didReceiveSegement(_ segment: String!)

Custom Parameters for iOS

The ironSource SDK supports custom parameters for Rewarded Video and Offerwall. You can pass custom parameters upon the initialization of the ad unit and receive the parameters upon a user’s completion event.

You can now pass custom parameters for all mediation networks on the ironSource mediation platform.

Note:
  1. Custom parameters work in conjunction with server-to-server completion callbacks only. You will receive the parameter as part of the callback string.
  2. You may insert more than one custom parameter in the init request. 

Implementation Code

Rewarded Video

Note:
  • Custom Parameters can be set several times per session.
  • To reset the value, use clearRewardedVideoServerParameters, and then set the new value.
[IronSource setRewardedVideoServerParameters:(NSDictionary *)parameters];
[IronSource clearRewardedVideoServerParameters];

Offerwall

Note:
  • Custom parameters should be called before calling showOW.
NSMutableDictionary * owDic = [[NSMutableDictionary alloc] init];
owDic[@"ip"] = @"1.0.0.9";
[ISConfigurations configurations].offerwallCustomParameters = owDic;

Implementation Example

For example, if you’d like to receive the IP of a user who engaged with the Offerwall, you can add this as an additional parameter in the completion callback:

NSMutableDictionary * owDic = [[NSMutableDictionary alloc] init];
owDic[@"ip"] = @"1.0.0.9";
[ISConfigurations configurations].offerwallCustomParameters = owDic;

You will receive a corresponding callback as exemplified below:

http://www.mydomain.com/rewardsCallback?appUserId=[USER_ID]&rewards=[REWARDS]&eventId=[EVENT_ID]&itemName=[ITEM_NAME]&custom_ip=1.0.0.9

ironSource SDK Error Codes

ironSource provides an error feedback mechanism to provide explanation for any failure in the SDK integration. You will receive these errors when something went wrong or an aspect of the integration wasn’t completed correctly.

The ironSource Error object contains an error code and message. These are all the possible errors and their message based on their functions:

Error Codes Ad Unit Description
508 N/A • Init failure of the mediation/Network
• Calling a Demand Only API in non Demand Only mode
• Calling a non Demand Only API in Demand Only mode
509 Interstitial Show Fail: No ads to show
Rewarded Video
Offerwall
510 Interstitial Load Fail: Server response failed
Load Fail: Adapters loading failure
520 Interstitial Show Fail: No internet connection; 
ShouldTrackNetworkState is enabled
Rewarded Video Show Fail: No internet connection
Offerwall
524 Interstitial Show Fail: Placement %@ has reached its limit as defined per pace
Show Fail: Placement %@ has reached its capping limit
Rewarded Video
Offerwall
526 Interstitial Show Fail: Ad unit has reached its daily cap per session
Rewarded Video
527 Interstitial Load Fail: Instance does not exist in the waterfall
Show Fail: Instance does not exist in the waterfall
Rewarded Video
1022 Rewarded Video Show Fail: Cannot show an RV while another RV is showing
1023 Rewarded Video Show Fail: Show RV called when there are no available ads to show
1036 Interstitial Show Fail: Cannot show an interstitial while another interstitial is showing
1037 Interstitial Load Fail: Cannot load an interstitial while another interstitial is showing