AdMob Mediation

Introduction

The HyprMX Android AdMob Adapter allows you to integrate HyprMX in your AdMob rewarded, interstitial, and banner/MREC waterfalls. See below for instructions on how to set up a new adapter or upgrade to newer versions.

Compatibility

The HyprMX-AdMob adapter version 6.2.0.1 is compatible with AdMob 20.6.0+.

Setup Instructions

1. Open your existing application in Android Studio.

2. Add or update the following dependency to your app's build.gradle file:

dependencies {
    implementation 'com.hyprmx.android:HyprMX-AdMob:6.2.0.1'
}

If you are upgrading, remove the hyprmx maven url in your top-level build.gradle dependencies. HyprMX is distributed with Maven Central.

3. If you are upgrading, class names may have changed since you last updated the adapter. Please review Integrating HyprMX On The AdMob Dashboard Using Custom Events section below to ensure you are using the latest class names.

4. If you are using mediation extras to pass in user ID and/or user consent, follow the instructions in Optional: User ID & User Consent. HyprMXMediationExtras has been removed and replaced with HyprMXAdapterConfiguration.

Integrating HyprMX On The AdMob Dashboard Using Custom Events

  1. Create your Mediation Group on the AdMob dashboard. If you are integrating Interstitial and Rewarded Video, follow these steps for both.

  2. In the Ad Sources section, select Add Custom Event.

  3. In the popup, enter HyprMX in the label field and set the default eCPM (e.g. $15.00).

  4. Click 'Continue'.

  5. Set the adapter Class Name:

  6. In the parameter field, enter the distributor ID and placement name assigned to you by your HyprMX account manager. Please reach out to your account manager with what placements you'd like to use in your app and whether they will be rewarded or interstitial. The example below will assume that your account manager has created a "REWARDED" placement.

    { "distributorID": "YOUR_DISTRIBUTOR_ID", "placementName": "REWARDED" }
  7. Click 'Done' and then 'Save'.

Optional: Tag for Child Directed Treatment

Regional laws and regulations such as COPPA, GDPR, and Google Play Store policies require child-directed treatment of applicable users. If you participate in Google Play’s Families Program, are listed in Google Play’s Family section, or include children as one of the target audiences, it is your responsibility as the app developer to ensure compliance with regional laws and regulations, and Google Play's Families Program, including, and not limited to, Google Play Families Policies to prevent access to the AAID for end-users flagged as children.

For instructions on how to tag the ad request as child directed, please follow the AdMob's child-directed setting documentation.

Optional: User ID & User Consent

User ID

If your app relies on server-to-server callbacks and requires you to set a static user ID that is publisher-defined for Rewarded Video, pass the user ID as instructed below. Please contact your HyprMX account services representative if you would like to implement a postback.

The user ID should not contain personal information such as an email address, screen name, Android Device ID (AID), or Google Advertising ID/Android Advertising ID (GAID/AAID).

Add User Consent Status

HyprMX provides an API to indicate a user’s consent status. This API will be used to indicate a user’s opt-in or opt-out consent for the collection and use of personal data under applicable laws and jurisdictions (GDPR, CPRA, etc.). You can set CONSENT_DECLINED by calling setHasUserConsent(false), or CONSENT_GIVEN with setHasUserConsent(true) depending on the user's consent collected by your application. Not setting consent will leave the status as CONSENT_STATUS_UNKNOWN.

Pass the user ID and consent status with the HyprMXAdapterConfiguration before initializing AdMob.

String userId = "REPLACE_WITH_CUSTOM_USER_ID";

HyprMXAdapterConfiguration.INSTANCE.setUserId(userId);

// Consent is optional.  Not setting leaves the consent status as unknown.
    
// Consent has been given
HyprMXAdapterConfiguration.INSTANCE.setHasUserConsent(true);

 // Consent has been declined
HyprMXAdapterConfiguration.INSTANCE.setHasUserConsent(false);

MobileAds.initialize(activity);

License

By integrating the HyprMX SDK, you are agreeing to the End User License Agreement.

Last updated