Hi,
Thank you for contacting the Mobile Ads SDK Support team.
To pass custom parameters, you will leverage the ServerParameters bundle within the MediationBannerAdConfiguration object. Please refer to these Set up a custom event and also Banner ads custom events for more information regarding custom events setup.
![]() |
Mobile Ads SDK Team |
Hi,
Thank you for contacting us.
I am checking your issue, I will get back to you with the solution shortly.
Hi,
If you are having AdRequest.Builder instance, please follow the below approach:
AdRequest.Builder requestBuilder = new AdRequest.Builder();
requestBuilder.addCustomTargetingParameter(“Key”: “Value”);
If any custom Mediation using, then Create Bundle:
Bundle extras = new Bundle();
extras(“Key”: “Value”);
Set extras on AdRequest.Builder
requestBuilder.setMediationExtras(mediationExtras);
Now you can retrieve them by overriding loadAd
@Override
public void loadAd(MediationBannerAdConfiguration configuration, MediationResponseCallback callback) {
Bundle extras = configuration.getMediationExtras();
if (extras != null) {
String value1 = extras(“Key”);
String value2 = extras(“Key”);
// Here you can use value for
}
// Handle here as per your mediation network requirements.
}
Kindly reach out to us, if you need any further assistance.
public static final class MediationExtrasBundleBuilder { // Keys to add and obtain the extra parameters from the bundle. public static final String KEY_AWESOME_SAUCE = "awesome_sauce"; public static final String KEY_INCOME = "income"; /** * An extra value used to populate the "ShouldAddAwesomeSauce" property of the Sample SDK's ad * request. */ private boolean shouldAddAwesomeSauce; /** * An extra value used to populate the "income" property of the Sample SDK's ad request. */ private int income; public MediationExtrasBundleBuilder setShouldAddAwesomeSauce( boolean shouldAddAwesomeSauce) { this.shouldAddAwesomeSauce = shouldAddAwesomeSauce; return MediationExtrasBundleBuilder.this; } public MediationExtrasBundleBuilder setIncome(int income) { this.income = income; return MediationExtrasBundleBuilder.this; } public Bundle build() { Bundle extras = new Bundle(); extras.putBoolean(KEY_AWESOME_SAUCE, shouldAddAwesomeSauce); extras.putInt(KEY_INCOME, income); return extras; } } setup the extras Bundle as mentioned in the above code and pass the adapter class and extras bundle through addNetworkExtrasBundle.
AdRequest request = new AdRequest.Builder()
.addNetworkExtrasBundle(SampleAdapter.class, extras)
.build();
// replace SampleAdapter.class with your custom event class.
Kindly refer this GitHub repository for further assistance.
Hope this helps and thank you for your patience.