Stay organized with collections
Save and categorize content based on your preferences.
This page covers the instructions to migrate ad requests.
The Next Gen Mobile Ads SDK requires you to pass the
Ad Manager ad unit ID directly to the AdRequest object,
rather than passing it to the load ad method.
The following examples pass extra parameters to a sample ad source adapter in
the current and Next Gen Mobile Ads SDKs. For details on passing extra
parameters to a specific ad source adapter, see the corresponding
ad source integration guide.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["| **Last updated:** January 10, 2025\n\n\u003cbr /\u003e\n\nThis page covers the instructions to migrate ad requests.\n\nThe Next Gen Mobile Ads SDK requires you to pass the\nAd Manager ad unit ID directly to the `AdRequest` object,\nrather than passing it to the load ad method.\n\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Current | Kotlin ```kotlin val adRequest = AdRequest.Builder().build() InterstitialAd.load( this, \"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\", adRequest, object : InterstitialAdLoadCallback() { } ) ``` Java ```java AdRequest adRequest = new AdRequest.Builder().build(); InterstitialAd.load( this, \"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\", adRequest, new InterstitialAdLoadCallback() { } ); ``` |\n| Next Gen | Kotlin ```kotlin val adRequest = AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\").build() InterstitialAd.load(adRequest, object : AdLoadCallback\u003cInterstitialAd\u003e {}) ``` Java ```java AdRequest adRequest = new AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\").build(); InterstitialAd.load(adRequest, new AdLoadCallback\u003cInterstitialAd\u003e() {}); ``` |\n\nPass extra parameters to Ad Manager\n\nThe following examples pass extra parameters to Ad Manager in the\ncurrent and Next Gen Mobile Ads SDKs to request non-personalized ads:\n\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Current | Kotlin ```kotlin val extras = Bundle() extras.putInt(\"npa\", 1) val request = AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter::class.java, extras) .build() ``` Java ```java Bundle extras = new Bundle(); extras.putInt(\"npa\", 1); AdRequest request = new AdRequest.Builder() .addNetworkExtrasBundle(AdMobAdapter.class, extras) .build(); ``` |\n| Next Gen | Kotlin ```kotlin val extras = Bundle() extras.putInt(\"npa\", 1) val request = AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\") .setGoogleExtrasBundle(extras) .build() ``` Java ```java Bundle extras = new Bundle(); extras.putInt(\"npa\", 1); AdRequest request = new AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\") .setGoogleExtrasBundle(extras) .build(); ``` |\n\nPass extra parameters to an ad source adapter\n\nThe following examples pass extra parameters to a sample ad source adapter in\nthe current and Next Gen Mobile Ads SDKs. For details on passing extra\nparameters to a specific ad source adapter, see the corresponding\n[ad source integration guide](/ad-manager/mobile-ads-sdk/android/early-access/nextgen/mediation/choose-networks#network_details).\n\n|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Current | Kotlin ```kotlin val extras = Bundle() extras.putString(\"exampleKey\", \"exampleValue\") val request = AdRequest.Builder() .addNetworkExtrasBundle(SampleAdapter::class, extras) .build() ``` Java ```java Bundle extras = new Bundle(); extras.putString(\"exampleKey\", \"exampleValue\"); AdRequest request = new AdRequest.Builder() .addNetworkExtrasBundle(SampleAdapter.class, extras) .build(); ``` |\n| Next Gen | Kotlin ```kotlin val extras = Bundle() extras.putString(\"exampleKey\", \"exampleValue\") val request = AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\") .putAdSourceExtrasBundle(SampleAdapter::class.java, extras) .build() ``` Java ```java Bundle extras = new Bundle(); extras.putString(\"exampleKey\", \"exampleValue\"); AdRequest request = new AdRequest.Builder(\"\u003cvar class=\"readonly\" translate=\"no\"\u003eAD_UNIT_ID\u003c/var\u003e\") .putAdSourceExtrasBundle(SampleAdapter.class, extras) .build(); ``` |"]]