GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

GAM Next-Gen module

Use this module for Google Ad Manager custom native and banner ads with Experiences SDK 1.20 or later. It runs on the GMA Next-Gen SDK.

For Experiences SDK through 1.19, use the GAM module (legacy). The API matches. See the migration guide.

Don't add both the legacy GAM module and the GAM Next-Gen module to the same app. The legacy Google Mobile Ads SDK and the GMA Next-Gen SDK can't run together.

Set up the GAM Next-Gen module

1. Declare the dependency

In your app module build.gradle:

// Experiences SDK
def blazeSDK = '<VERSION>'

dependencies {  
    implementation group: "com.blaze", name: "gam-next-gen", version: "${blazeSDK}"  
}

If another dependency still pulls in the legacy Google Mobile Ads SDK, exclude it globally so nothing can reintroduce it. See Google migration guidance:

configurations.all {
    exclude group: 'com.google.android.gms', module: 'play-services-ads'
    exclude group: 'com.google.android.gms', module: 'play-services-ads-lite'
}

2. Set your Ad Manager app ID

Add your Ad Manager app ID to the app Manifest. Find it in Google Ad Manager under Inventory > Apps (Google labels it App ID):

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <application>

      ...

        <!-- Google Ad Manager -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxx~xxxxxxxx" />

    </application>
</manifest>

3. Enable ads

Call these from your Activity or Application class.

Custom native ads

BlazeGAM.enableCustomNativeAds(
  context = applicationContext,
  defaultAdsConfig = gamCustomNativeAdsDefaultConfig,
  delegate = gamCustomNativeAdsDelegate
)

To disable:

BlazeGAM.disableCustomNativeAds()

Banner ads

BlazeGAM.enableBannerAds(
  context = applicationContext,
  delegate = gamBannerAdsDelegate
)

To disable:

BlazeGAM.disableBannerAds()

Initialization

The GMA Next-Gen SDK must finish initializing before any ad request. The legacy module doesn't require that wait. BlazeGAM handles initialization for you. You don't add a separate init step beyond calling enableBannerAds or enableCustomNativeAds.

  • Start: Initialization begins the first time you call either enable method.
  • Queuing: Ad requests wait until initialization finishes, for up to 60 seconds.
  • Failures: If initialization fails or times out, your existing ad error callback receives the failure. That includes cases such as an unset Ad Manager app ID. There's no separate init callback to implement.

Differences from the legacy module

The API matches the GAM module (legacy). These differences come from the Google library each module uses:

TopicGAM module (legacy)GAM Next-Gen module
Google libraryLegacy Google Mobile Ads SDKGMA Next-Gen SDK
Banner view typeAdManagerAdViewAdView
Custom native ad typeLegacy Google native ad typeCustomNativeAd
InitializationRuns in the background without waitingWaits internally before each ad request, with a timeout

This module exposes only banner and custom native ads, same as the legacy module. It doesn't expose other GMA Next-Gen formats such as interstitial, rewarded, or mediation.


Did this page help you?