Configure Mediation

Test Mode

Mediation 1.1.0 introduces a Test Mode setting that will allow you to test your partner integrations and get their test ads. To enable, simply add the environment variable HELIUM_TEST_MODE in your app’s scheme. Remember to remove it or set the method to off before releasing your app.


Privacy Methods

The following privacy methods are used to set different privacy settings:

COPPA

setSubjectToCoppa

[[HeliumSdk sharedHelium] setSubjectToCoppa:YES];
// or
[[HeliumSdk sharedHelium] setSubjectToCoppa:NO];
  • By sending setSubjectToCoppa (YES), you indicate that you want your content treated as child-directed for purposes of COPPA. We will take steps to disable interest-based advertising for such ad requests.
  • By sending setSubjectToCoppa (NO), you indicate that you don't want your content treated as child-directed for purposes of COPPA. You represent and warrant that your applications and services are not directed towards children and that you will not provide any information to Mediation from a user under the age of 13.

GDPR

setSubjectToGDPR

[[HeliumSdk sharedHelium] setSubjectToGDPR:YES];
// or
[[HeliumSdk sharedHelium] setSubjectToGDPR:NO];
  • By sending setSubjectToGDPR (YES), you indicate that GDPR is applied to this user from your application.
  • By sending setSubjectToGDPR (NO), you indicate that GDPR is not applied to this user from your application.

setUserHasGivenConsent

[[HeliumSdk sharedHelium] setUserHasGivenConsent:YES];
// or
[[HeliumSdk sharedHelium] setUserHasGivenConsent:NO];
  • By sending setUserHasGivenConsent (YES), you indicate that this user from your application has given consent to share personal data for behavioral targeted advertising.
  • By sending setUserHasGivenConsent (NO), you indicate that this user from your application has not given consent to use its personal data for behavioral targeted advertising, so only contextual advertising is allowed.

CCPA

setCCPAConsent

[[HeliumSdk sharedHelium] setCCPAConsent:YES];
// or
[[HeliumSdk sharedHelium] setCCPAConsent:NO];
  • By sending setCCPAConsent (YES), you indicate that this user from your application has given consent to share personal data for behavioral targeted advertising under CCPA regulation.
  • By sending setCCPAConsent (NO), you indicate that this user from your application has not given consent to allow sharing personal data for behavioral targeted advertising under CCPA regulation.

📘

Note:

Mediation will send CCPA information to bidding networks and set the CCPA information to the adapters.


Keywords

As of Mediation 2.9.0, the Mediation SDKs introduces keywords: key-value pairs to enable real-time targeting on line items.

Set Keywords

To set keywords, you will need to first create a Mediation ad object, then use the setKeyword method to add key-value keywords pair.

// Create a Mediation Ad object.
id<HeliumInterstitialAd> interstitial = [HeliumSdk.sharedHelium interstitialAdProviderWithDelegate:self andPlacementName:@"placement"];
id<HeliumRewardedAd> rewarded =
[HeliumSdk.sharedHelium rewardedAdProviderWithDelegate:self andPlacementName:@"placement"];
HeliumBannerView *banner =
[HeliumSdk.sharedHelium bannerProviderWithDelegate:self andPlacementName:@"placement" andSize:CHBHBannerSize_Standard];
// Setting Keyword
// (The set method returns a boolean whether or not if the keyword has been successfully set)
BOOL success = [interstitial.keywords setKeyword:@"i12_keyword1" value:@"i12_value1"];
if (success == NO) {
// Failed to set keyword
}
BOOL success = [rewarded.keywords setKeyword:@"rwd_keyword1" value:@"rwd_value1"];
if (success == NO) {
// Failed to set keyword
}
BOOL success = [banner.keywords setKeyword:@"bnr_keyword1" value:@"bnr_value1"];
if (success == NO) {
// Failed to set keyword
}

Remove Keywords

To remove keywords, simply use the removeKeyword method and pass the key you would like to remove.

// Remove Custom Keyword (The remove method returns the value of the key removed)
NSString *removedi12KeywordValue = [interstitial.keywords removeKeyword:@"i12_keyword1"];
NSString *removedRewardedKeywordValue = [rewarded.keywords removeKeyword:@"rwd_keyword1"];
NSString *removedBannerKeywordValue = [banner.keywords removeKeyword:@"bnr_keyword1"];

Note: Keywords has restrictions for setting keys and values. The maximum characters allowed for keys is 64 characters. The maximum characters for values is 256 characters.

Impression Level Revenue Data (ILRD)

Impression Level Revenue Data (ILRD) is data we already collect on the server-side and store in our database today. This feature allows publishers to get access to this data.

An ILRD event occurs every time an impression is tracked. The fields that a publisher is interested in are broken down as follows:

ILRD KeyValueILRD Description
"ad_revenue"DoubleDouble precision floating point
"currency_type"StringAlways USD
"country"USAThree letter country code ISO_3166-1_alpha-3
"impression_id"StringID
"line_item_name"StringMediation line item name
"line_item_id"StringMediation line item id
"network_name"StringNetwork Name
"network_placement_id"StringPartner placement name
"network_type"StringEither bidding or mediation
"placement_name"StringMediation placement name
"placement_type"StringAd type:
- interstitial
- rewarded
- banner
"precision"StringOne of the following:
- estimated,
- exact,
- publisher_defined,
- undisclosed
{
 "ad_revenue": 0.055,
 "currency_type": "USD",
 "country": "USA",
 "impression_id": "ae112f3dccf90c705f2d3b1324605e9d16687725",
 "line_item_name": "helium_rv_T1_tapjoy_high",
 "line_item_id": "33f6b0ca-1b3c-4e69-80dd-b57db13db159",
 "network_name": "tapjoy",
 "network_placement_id": "tapjoy_RV_0_25",
 "network_type": "mediation",
 "placement_name": "heliumTapjoyTest",
 "placement_type": "rewarded",
 "precision": "publisher_defined"
}

Publishers will have two ways of receiving this data:

  1. On iOS, we provide a global notification that gives publishers access to ILRD data on each impression event shown in real-time.
  2. For API access, we will provide an ILRD reporting API where publishers can request a custom report (CSV) of all their ILRD data filtered by appId, min_date, max_date.

Publishers will use ILRD data in several ways:

  • They can listen to the data via SDK notifications in real time and ship it to their own servers, or to other MMPs such as Appsflyer & Adjust.
  • They can manually request a report via the API endpoint and analyze it whenever they wish to do so.

Note: Meta Audience Network Ad Revenue

  • Unlike other networks, Meta prohibits Mediation from sharing the real ad_revenue value of Meta Audience Network impressions with publishers.
  • Instead, Mediation is only allowed to share the average of aggregated eCPMs of Meta Audience Network line items.

Rewarded Callbacks

Setting the User ID and Custom Data through the SDK

Setting User Identifier

The user identifier property is found on the HeliumSdk object. This property may be set anytime after SDK initialization.

HeliumSdk.sharedHelium.userIdentifier = @"user";

Setting Custom Data

The custom data property is found on the HeliumRewardedAd instance, and has a maximum character limit of 1000 characters. In the event that the limit is exceeded, the customData property will be set to nil.

Custom data may be set at any time before calling showAdWithViewController:.

It is recommended to base 64 encode the custom data!

id<HeliumRewardedAd> rewardedAd = [HeliumSdk.sharedHelium rewardedAdProviderWithDelegate:self andPlacementName:@"placement"];
// load ad
NSData *customData = [@"custom data" dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64CustomData = [customData base64EncodedDataWithOptions:0];
rewardedAd.customData = base64CustomData;
// show ad

See: Mediation SDK: Manage Placement's Rewarded Callbacks for configuration setup


Implementation

The iOS SDK will provide a new NSNotification event that will be broadcast to all listeners via NSNotificationCenter.

The HeliumImpressionData class will be specified as follows:

public class HeliumImpressionData: NSObject {
  // The placement associated with Impression Level Revenue Data.
  let placement: String

  // The Impression Level Revenue Data JSON.
  let jsonData: [String : Any]
}

Usage Example

[NSNotificationCenter.defaultCenter addObserver:self                                
                                    selector:@selector(didReceiveILRDNotification:)
                                    name:kHeliumDidReceiveILRDNotification
                                    object:nil];

- (void)didReceiveILRDNotification:(NSNotification *)notification {
    // Extract the ILRD payload.
    HeliumImpressionData *ilrd = notification.object;
    
    // Placement name
    NSString *placement = ilrd.placement;

    // JSON
    NSDictionary *json = ilrd.jsonData;
}