Catch up on everything announced at Firebase Summit, and learn how Firebase can help you accelerate app development and run your app with confidence. Learn More

Use more features of Google Analytics and Firebase with AdMob apps

Stay organized with collections Save and categorize content based on your preferences.

After completing the basic AdMob setup, you can also add the Firebase SDK for Google Analytics to take advantage of other features from Google Analytics and Firebase. Learn how to get started with Google Analytics later on this page.

These increasing levels of configuration support features that can help you optimize your app's user experience and your ad revenue. Check out the following table of features and its links to learn more!

Feature Add Mobile Ads SDK +
enable user metrics
Add Mobile Ads SDK +
enable user metrics and
Link AdMob to Firebase
Add Mobile Ads SDK +
enable user metrics and
Link AdMob to Firebase and
Add Firebase SDK for Analytics
View user metrics in your AdMob account
Automatically collect analytics events and user properties from your app
View curated user metrics in AdMob
Explore and work with your analytics data via Firebase
View key metrics in the Firebase console
Mark conversions for ad campaigns
Build custom audiences
Export and analyze data in BigQuery
Access more customization features for your analytics data
Log custom events for analytics and models (like logging ecommerce_purchase events for ARPU and ARPPU metrics)
Configure custom conversions for ad campaigns
Use other Firebase products
(like Remote Config and A/B Testing)

Get started with Google Analytics

Google Analytics is Firebase's analytics engine that gives you access to powerful insights into your data. Start using Google Analytics in your app by adding the Firebase SDK for Google Analytics.

The following steps describe how to start using the Firebase SDK for Google Analytics in your app. After initializing the SDK, visit the Analytics documentation to learn how to start logging events in your app.

Step 1: Add a configuration file to your app

If you registered your app with Firebase before creating an AdMob link, then you already added a Firebase configuration file to your app. Check for a GoogleService-Info.plist file in the root of your Xcode project. Also make sure that the config file is added to all targets.

Step 2: Add the Firebase SDK for Analytics to your app

  1. Add the dependency for the Firebase SDK for Google Analytics to your Podfile:

    pod 'FirebaseAnalytics'
  2. Run pod install, then open the created .xcworkspace file.

  3. Import the FirebaseCore module in your UIApplicationDelegate, as well as any other Firebase modules your app delegate uses. For example, to use Cloud Firestore and Authentication:


    import FirebaseCore
    import FirebaseFirestore
    import FirebaseAuth
    // ...


    @import FirebaseCore;
    @import FirebaseFirestore;
    @import FirebaseAuth;
    // ...
  4. Configure a FirebaseApp shared instance in your app delegate's application(_:didFinishLaunchingWithOptions:) method:


    // Use Firebase library to configure APIs


    // Use Firebase library to configure APIs
    [FIRApp configure];

Implement custom event logging

This section shows an example of how to implement custom event logging in your app. This specific example is for the custom event ecommerce_purchase which is a helpful event to log for AdMob-linked apps, especially for calculating ARPU and ARPPU.

Here's how to implement custom event logging in your app:

  1. Make sure that you've completed the Get started with Google Analytics section of this page, which includes configuring your app to use Firebase, adding the Firebase SDK for Google Analytics, and initializing the SDK.

  2. Log an ecommerce_purchase event (Swift | Obj-C). Here's an example:


    Analytics.logEvent(AnalyticsEventPurchase, parameters: [
      AnalyticsParameterCoupon: "SummerPromo",
      AnalyticsParameterCurrency: "JPY",
      AnalyticsParameterValue: 10000,
      AnalyticsParameterShipping: 500,
      AnalyticsParameterTransactionID: "192803301",


    [FIRAnalytics logEventWithName:kFIREventPurchase
      kFIRParameterCoupon: @"SummerPromo",
      kFIRParameterCurrency: @"JPY",
      kFIRParameterValue: @10000,
      kFIRParameterShipping: @500,
      kFIRParameterTransactionID: @"192803301",

To learn more about logging custom events in your app, visit the Analytics documentation.

Use other Firebase products in your app

After you add the Firebase SDK for Google Analytics, you can also start using other Firebase products, like Firebase Remote Config and Firebase A/B Testing.

  • Remote Config enables you to change the behavior and appearance of your app without publishing an app update, at no cost, for unlimited daily active users.

  • A/B Testing gives you the power to test changes to your app’s UI, features, or engagement campaigns to learn if they make an impact on your key metrics (like revenue and retention) before rolling the changes out widely.