Configure Mediation

Test Mode πŸ”—

The Mediation SDK includes a Test Mode method that will allow you to test your partner integrations and get their test ads. To enable Test Mode, simply set the following method to true after starting the Mediation SDK. Remember to remove it or set the method to false before releasing your app.

  • HeliumSdk.setTestMode(true)
    HeliumSdk.setTestMode(false)
    
  • HeliumSdk.setTestMode(true);
    HeliumSdk.setTestMode(false);
    

Privacy Methods πŸ”—

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

COPPA πŸ”—

setSubjectToCoppa πŸ”—

  • HeliumSdk.setSubjectToCoppa(true)
    // or
    HeliumSdk.setSubjectToCoppa(false)
    
  • HeliumSdk.setSubjectToCoppa(true);
    // or
    HeliumSdk.setSubjectToCoppa(false);
    
  • By sending setSubjectToCoppa(true), 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(false), 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.setSubjectToGDPR(true)
    // or
    HeliumSdk.setSubjectToGDPR(false)
    
  • HeliumSdk.setSubjectToGDPR(true);
    // or
    HeliumSdk.setSubjectToGDPR(false);
    
  • By sending setSubjectToGDPR(true), you indicate that GDPR is applied to this user from your application.
  • By sending setSubjectToGDPR(false), you indicate that GDPR is not applied to this user from your application.

setUserHasGivenConsent πŸ”—

  • HeliumSdk.setUserHasGivenConsent(true)
    // or
    HeliumSdk.setUserHasGivenConsent(false)
    
  • HeliumSdk.setUserHasGivenConsent(true);
    // or
    HeliumSdk.setUserHasGivenConsent(false);
    
  • By sending setUserHasGivenConsent(true), you indicate that this user from your application has given consent to share personal data for behavior-targeted advertising.
  • By sending setUserHasGivenConsent(false), you indicate that this user from your application has not given consent to use its personal data for behavior-targeted advertising, so only contextual advertising is allowed.

CCPA πŸ”—

setCCPAConsent πŸ”—

  • HeliumSdk.setCCPAConsent(true)
    // or
    HeliumSdk.setCCPAConsent(false)
    
  • HeliumSdk.setCCPAConsent(true);
    // or
    HeliumSdk.setCCPAConsent(false);
    
  • By sending setCCPAConsent(true), you indicate that this user from your application has given consent to share personal data for behavior-targeted advertising under CCPA regulation.
  • By sending setCCPAConsent(false), you indicate that this user from your application has not given consent to allow sharing personal data for behavior-targeted advertising under CCPA regulation.

Keywords πŸ”—

Starting in version 2.9.0, the Mediation SDK introduces keywordsβ€”key-value pairs that can be set to enable real-time targeting of line items.

Set Keywords πŸ”—

To set keywords, you will need to first create a Mediation ad object. Then, use the set() method to add key-value keywords pair. The set method returns a boolean indicating whether or not the keyword has been successfully set.

  • // Create a Helium ad object.
    val interstitialAd = HeliumInterstitialAd(placementName, heliumInterstitialAdListener)
      
    val rewardedAd = HeliumRewardedAd(placementName, heliumRewardedAdListener)
      
    val bannerAd = HeliumBannerAd(context, placementName, bannerSize, heliumBannerAdListener)
      
    interstitialAd.keywords["i12_keyword1"] = "i12_value1"
      
    rewardedAd.keywords["rwd_keyword1"] = "rwd_value1"
      
    bannerAd.keywords["bnr_keyword1"] = "bnr_value1"
    
  • // Create a Helium ad object.
    HeliumInterstitialAd interstitialAd = new HeliumInterstitialAd(placementName, heliumInterstitialAdListener);
      
    HeliumRewardedAd rewardedAd = new HeliumRewardedAd(placementName, heliumRewardedAdListener);
      
    HeliumBannerAd bannerAd = new HeliumBannerAd(context, placementName, bannerSize, heliumBannerAdListener);
    
    interstitialAd.getKeywords().set("i12_keyword1", "i12_value1");
      
    rewardedAd.getKeywords().set("rwd_keyword1", "rwd_value1");
      
    bannerAd.getKeywords().set("bnr_keyword1", "bnr_value1");
    

Remove Keywords πŸ”—

To remove keywords that have been set, simply use the remove() method and pass in the key whose value you would like to remove. The remove method returns the value of the key removed.

  • // Remove keyword
    interstitialAd.remove("i12_keyword1")
    rewardedAd.remove("rwd_keyword1")
    bannerAd.remove("bnr_keyword1")
    
  • // Remove keyword
    interstitialAd.remove("i12_keyword1");
    rewardedAd.remove("rwd_keyword1");
    bannerAd.remove("bnr_keyword1");
    

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 Key Value ILRD Description
"ad_revenue" Double Double-precision floating point
"currency_type" String Always USD
"country" String Three-letter country code ISO_3166-1_alpha-3 (ex. β€œUSA”)
"impression_id" String ID
"line_item_name" String Mediation line item name
"line_item_id" String Mediation line item id
"network_name" String Network Name
"network_placement_id" String Partner placement name
"network_type" String Either bidding or mediation
"placement_name" String Mediation placement name
"placement_type" String Ad type:
- interstitial
- rewarded
- banner
"precision" String One of the following:
- estimated
- exact
- publisher_defined
- undisclosed

Bid Specific ILRD πŸ”—

{
 "network_name": "chartboost",
 "network_type": "bidding",
 "precision": "exact",
 "ad_revenue": 0.099,
 "network_placement_id": "CBRewarded"
}

Ad Response ILRD πŸ”—

{
 "impression_id": "7e4c99a9492c75f3b5fcbb4da8cd8e040794c4fe",
 "currency_type": "USD",
 "country": "USA",
 "placement_name": "CBRewarded",
 "placement_type": "rewarded"
}

Combined ILRD Response πŸ”—

{
 "ad_revenue": 0.055,
 "currency_type": "USD",
 "country": "USA",
 "impression_id": "ae112f3dccf90c705f2d3b1324605e9d16687725",
 "line_item_name": "helium_rv_T1_mintegral_high",
 "line_item_id": "33f6b0ca-1b3c-4e69-80dd-b57db13db159",
 "network_name": "mintegral",
 "network_placement_id": "mintegral_RV_0_25",
 "network_type": "mediation",
 "placement_name": "heliumMintegralTest",
 "placement_type": "rewarded",
 "precision": "publisher_defined"
}

Publishers can receive ILRD data in two ways:

  1. On Android, 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 can 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 can use ILRD data in several ways:

  • You can listen to the data via SDK notifications in real-time and ship it to your own servers or to other MMPs such as AppsFlyer or Adjust.
  • You can manually request a report via the API endpoint and analyze it at your convenience.

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.setUserIdentifier("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 null.

Custom data may be set at any time before calling show().

It is recommended to base 64 encode the custom data!

val rewardedAd: HeliumRewardedAd = // create your HeliumRewardedAd

// load ad

val base64EncodedCustomData = "Y3VzdG9tIGRhdGE="
rewarded.customData = base64EncodedCustomData
// show ad

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

Implementation πŸ”—

Create a HeliumIlrdObserver object and implement its onImpression method. Then, pass the object to the HeliumSdk.subscribe and HeliumSdk.unsubscribe methods.

  • val ilrdObserver = object: HeliumIlrdObserver {
      override fun onImpression(impData: HeliumImpressionData) {
          // Placement name
          val placement = impData.placementId
          // JSON
          val json = impData.ilrdInfo
      }
    }
    
    override fun onCreate(savedInstanceState: Bundle?) {
      ...
      // Subscribe to ILRD on app startup, e.g. in onCreate()
      HeliumSdk.subscribeIlrd(ilrdObserver)
      ...
    }
    
    override fun onDestroy() {
      ...
      // Unsubscribe from ILRD on app terminations, e.g. in onDestroy()
      HeliumSdk.unsubscribeIlrd(ilrdObserver)
      ...
    }
    
  • HeliumIlrdObserver ilrdObserver = new HeliumIlrdObserver() {
        @Override
        public void onImpression(@NonNull HeliumImpressionData heliumImpressionData) {
            // Placement name
            String placementId = heliumImpressionData.getPlacementId();
            // JSON
            JSONObject json = heliumImpressionData.getIlrdInfo();
        }
    };
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      ...
      // Subscribe to ILRD on app startup, e.g. in onCreate()
      HeliumSdk.subscribeIlrd(ilrdObserver);
      ...
    }
    
    @Override
    protected void onDestroy() {
      ...
      // Unsubscribe from ILRD on app terminations, e.g. in onDestroy()
      HeliumSdk.unsubscribeIlrd(ilrdObserver);
      ...
    }