AdMob-Firebase Integration (Android Beta)

The AdMob-Firebase integration lets us share your data between the AdMob and Firebase platform. If you're a Firebase and AdMob user, Firebase will have access to your ads data and AdMob will have access to your app and analytics data.

This feature is still in public beta for Android apps. If you would like to participate in the beta today, you can download and integrate a special beta-build of our SDKs.

Android Beta-build integration steps

  1. Download the beta-build of the AdMob and Firebase SDKs here.

  2. Configure a local Maven repository.

    Integrating the EAP build of the Google Mobile Ads Android requires you to configure a local maven repository. Gradle will look for the location of the local Maven repository by checking the following (in order of precedence):

    1. A settings.xml file in $HOME/.m2/, which specifies a local Maven repository directory. Note: On Windows, this is sometimes located in %USERPROFILE%\.m2.
    2. A settings.xml file in$M2_HOME/conf/, which specifies a local Maven repository directory.
    3. If no settings.xml file is found, Gradle uses the default location of $HOME/.m2/repository/ as the local Maven repository directory. If this directory doesn't exist, it should be created.

    Once you've determined the correct location, add the contents of the GoogleMobileAds-Android-Beta-10.2.3.zip file to the local Maven repository directory.

    Next, configure Gradle to use the local Maven repository by adding the bolded line below to the repository section of your project level build.gradle file.

    allprojects {
        repositories {
            mavenLocal()
            jcenter()
        }
    }
  3. Add Google Mobile Ads EAP build dependency to your Gradle file.

    To use the EAP build of the Google Mobile Ads SDK in your project, you'll need to reference it as a dependency in your app's build.gradle file. Open the application level build.gradle file and add the bolded line indicated below to the dependencies section.

    ...
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        ...
        compile 'com.google.firebase:firebase-ads:10.2.3'
        compile 'com.google.firebase:firebase-analytics:10.2.3'
    }
    ...
  4. If you're using ProGuard, add the following to your ProGuard config (by default proguard-rules.pro)

    -keep public class com.google.firebase.analytics.FirebaseAnalytics {
        public *;
    }
    
    -keep public class com.google.android.gms.measurement.AppMeasurement {
        public *;
    }

Verification instructions

In order to verify that the integration is working properly, you can use Firebase's DebugView (instructions) to see whether the ad_click and ad_impression events are being sent from your app. After configuring DebugView, trigger an ad_impression event, by loading and viewing an ad in your app.

Send feedback about...

Need help? Visit our support page.