使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将 Firebase 与 Google AdMob 结合使用
plat_ios
plat_android
plat_cpp
plat_unity
Google AdMob 是通过在应用内投放有针对性的广告,利用移动应用创收的一种简单方式。
Google AdMob 是一个助您通过应用实现创收的移动广告平台。将 Firebase 与
AdMob 结合使用,可为您提供额外的应用使用情况数据和分析功能。
准备好开始了吗?选择您的平台:
iOS+
Android
Unity
C++
主要功能
从应用内广告中获得更多收益 |
实时显示数百万家 Google 广告主的广告,或使用 AdMob 中介从 40 多家高级广告联盟获利。您可以免费简化广告运营、提高竞争能力并获得更多收入。
AdMob 中介内置了广告联盟优化功能,可自动调整您的其他广告联盟在中介堆栈中的位置,从而确保您的收益最大化。
|
改善用户体验 |
通过与应用的外观和风格相匹配,原生广告能够让您在创收的同时,打造积极的用户体验。选择不同广告模板,自定义这些模板,并实验不同布局。
|
快速扩展 |
当您的应用在全球或国内成为热门,您就可以通过向 200 多个市场的用户显示广告,借助 AdMob 通过用户迅速创收。
您是否有多个应用?AdMob 自家广告是一种免费工具,通过该工具,您能够在您的应用系列之间向您的用户群交叉宣传自己的各个应用。
|
访问获利报告 |
AdMob 是非常优秀的移动创收平台。在产生广告收入的同时,AdMob 还会生成创收报告,您可以此为基础对产品策略做出更加睿智的决策。
|
工作原理
Google AdMob 可以帮助您通过应用内广告从自己的移动应用创收。您可以使用各种格式选项来展示广告,这些选项已经无缝添加到平台原生界面组件中。在 Android 上,您可以额外展示应用内购买广告,让用户能够从您的应用内购买所宣传的产品。
如需展示广告,您需要一个集成了 Google Mobile Ads SDK (iOS | Android) 且已注册 AdMob 的应用。然后,您可以启用一个或多个广告单元 ID,这些 ID 是您应用中展示广告的位置的唯一标识符。
Mobile Ads SDK 可帮助您深入了解用户、提高应用内购买量以及最大限度提高广告收入。为此,默认集成的 SDK 会收集设备信息、发布商提供的位置信息,以及常规应用内购买信息(如商品购买价格和币种)。
用户指标、Firebase 和 Google Analytics
如需在优化应用的用户体验和广告收入方面作出明智的决策,您需要使用指标和应用数据。将 AdMob、Firebase 和 Google Analytics 结合使用可提供额外的配置功能,帮助您实现优化目标。
在 AdMob 账号中查看用户指标
在 AdMob 账号中启用用户指标,查看新数据及功能强大的报告(例如激励广告报告),这有助于为您的创收策略提供有用的信息。
通过 Firebase 探索和使用您的分析数据
将您的 AdMob 应用关联到 Firebase,有助于提高应用创收能力和用户互动度。例如,您可以构建自定义受众群体,甚至将 BigQuery 用于您的分析数据。
为分析数据使用更多自定义功能
添加支持 Google Analytics 的 Firebase SDK,以实现更多自定义分析功能(如自定义事件),在 AdMob 账号中查看更完整的用户指标,并开始使用其他 Firebase 产品。
详细了解这些额外配置功能的优势。
实现流程
|
配置您的应用以使用 Firebase |
在 Firebase 控制台中将 Firebase 添加到您的新应用或现有应用。
|
|
创建 AdMob 账号并注册应用 |
注册 AdMob 账号,然后将您的应用注册为 AdMob 应用。在发布之前,将您创建的所有广告单元 ID 添加到您的应用中。
|
|
启用用户指标并将您的 AdMob 应用关联到 Firebase |
(强烈建议选用)在您的 AdMob 账号中,启用用户指标以查看特选指标。然后将您的 AdMob 应用关联到 Firebase,以便通过 Firebase 控制台探索和使用您的分析数据。
|
|
更新项目依赖项 |
在 iOS 上使用 CocoaPods 或在 Android 上使用 Gradle 添加 Google Mobile Ads SDK。
|
|
在应用中植入首个广告 |
使用 Mobile Ads SDK 在您的应用界面中为横幅广告创建空间(绝佳选择)。您可以完全按照自己喜爱的方式设置布局,也可以使用会随设备的尺寸和屏幕方向自动调整大小的智能横幅。 |
后续步骤
阅读适用于 iOS 或 Android 的入门指南。
按照快速入门中的说明操作,在 iOS 和 Android 中设置 AdMob。
先在一小部分用户中尝试各种不同的广告格式或配置,然后根据测试数据决定为所有用户投放广告的方式,从而优化应用的广告创收模式。如需了解详情,请查看以下教程:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-04。
[null,null,["最后更新时间 (UTC):2025-08-04。"],[],[],null,["Use Firebase with Google AdMob \nplat_ios plat_android plat_cpp plat_unity \nGoogle AdMob is an easy way to monetize mobile apps\nwith targeted, in-app advertising. \n[Google AdMob](//admob.google.com/home/?utm_source=firebase&utm_medium=et&utm_campaign=firebase-docs&utm_content=2017Q1) is a mobile advertising platform that you can use to generate revenue from your app. Using Firebase with AdMob provides you with additional app usage data and analytics capabilities.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nReady to get started? Choose your platform:\n\n[iOS+](/docs/admob/ios/quick-start)\n[Android](/docs/admob/android/quick-start)\n[Unity](/docs/admob/unity/start)\n[C++](/docs/admob/cpp/quick-start)\n\n\u003cbr /\u003e\n\nKey capabilities\n\n|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Earn more from in-app ads | Show ads from millions of Google advertisers in real time or use AdMob mediation to earn from over 40 premium networks. Simplify your ad operations, improve competition, and earn more, for free. AdMob mediation has [ad network optimization](//support.google.com/admob/answer/3379794) built in, which automatically adjusts the positions of your other ad networks in your mediation stack, which maximizes your revenue. |\n| Improve user experience | Native ads create a positive user experience as you monetize by matching the look and feel of your app. Choose from different ad templates, customize them, and experiment with different layout. |\n| Scale fast | When your app is a global or domestic hit, you can monetize users quickly with AdMob, by showing ads to users in more than 200 markets. Do you have more than one app? House ads from AdMob is a free tool that enables you to cross-promote your apps to your user base, across your family of apps. |\n| Access monetization reports | AdMob is the premier monetization platform for mobile. While generating ad revenue, AdMob also produces its own monetization reports that you can use to make smarter decisions about product strategy. |\n\nHow does it work?\n\n[Google AdMob](//www.google.com/admob/?utm_source=firebase&utm_medium=et&utm_campaign=firebase-docs&utm_content=2017Q1)\nhelps you monetize your mobile app through in-app advertising. Ads can be\ndisplayed using various format options which are seamlessly added to platform\nnative UI components. On Android, you can additionally display in-app purchase\nads, allowing users to purchase advertised products from within your app.\n\n|--------|--------------|--------|----------|\n| Banner | Interstitial | Native | Rewarded |\n\nTo display ads, you'll need an AdMob-registered app that integrates the\nGoogle Mobile Ads SDK ([iOS](/docs/admob/ios/quick-start) \\|\n[Android](/docs/admob/android/quick-start)). You can then activate one or more\nAd Unit IDs which are unique identifiers for the places in your app to display\nads.\n\nThe Mobile Ads SDK helps you gain insights about your users, drive\nmore in-app purchases, and maximize ad revenue. To do all this, the default\nintegration of the SDK collects device information, publisher-provided location\ninformation, and general in-app purchase information (such as item purchase\nprice and currency).\n\nUser metrics, Firebase, and Google Analytics\n\nTo make informed decisions about optimizing your app's user experience and your\nad revenue, you'll need metrics and data from your app. Working together,\nAdMob, Firebase, and Google Analytics offer additional levels of\nconfiguration to help you achieve your optimization goals.\n\n1. **View user metrics in your AdMob account**\n\n [Enable user\n metrics](//support.google.com/admob/answer/9263723) in your\n AdMob account to access new data and powerful reports, such as the\n [rewarded report](//support.google.com/admob/answer/9005580),\n that may help inform your monetization strategy.\n2. **Explore and work with your analytics data via Firebase**\n\n [Link your AdMob app\n to Firebase](//support.google.com/admob/answer/6383165)\n to help you improve app monetization and user engagement. For example, you\n can build custom audiences and even use BigQuery with your analytics data.\n3. **Access more customization features for your analytics data**\n\n [Add the Firebase SDK for\n Google Analytics](/docs/admob/analytics-and-firebase) to implement\n more customized analytics (like custom events), view more complete user\n metrics in your AdMob account, and start using other Firebase products.\n\nLearn more about the [benefits](/docs/admob/analytics-and-firebase) of these\nadditional levels of configuration!\n\nImplementation path\n\n|---|---------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Configure your app to use Firebase | Add Firebase to your new or existing app in the Firebase console. |\n| | Create an AdMob account and register your app | [Sign up for an AdMob account](http://www.google.com/admob/?subid=WW-EN-ET-firebase-docs&utm_source=internal&utm_medium=et&utm_campaign=firebase-docs) and register your app as an AdMob app. Before you publish, add to your app any Ad Unit IDs that you've created. |\n| | Enable user metrics and link your AdMob app to Firebase | *(Optional, but strongly recommended)* In your AdMob account, enable user metrics to view curated metrics. Also, link your AdMob app to Firebase to explore and work with your analytics data via the Firebase console. |\n| | Update project dependencies | Add the Google Mobile Ads SDK using CocoaPods on iOS or Gradle on Android. |\n| | Implement your first ad in your app | Use the Mobile Ads SDK to create space in your app UI for a banner ad (a great place to start!). You can set the layout to just the way you like it or use smart banners that will resize depending on the device size and orientation. |\n\nNext steps\n\n- Learn how to get started on [iOS](/docs/admob/ios/quick-start) or\n [Android](/docs/admob/android/quick-start).\n\n- Follow the quickstart, a tutorial that guides you through setting up AdMob\n on [iOS](//github.com/firebase/quickstart-ios/tree/master/admob/)\n and\n [Android](//github.com/firebase/quickstart-android/tree/master/admob/).\n\n- Optimize ad monetization for your app by trying out different ad formats or\n configurations with a small subset of users, and then making data driven\n decisions about implementing the ad for all your users.\n To learn more, check out the following tutorials:\n\n - *Test new ad format adoption*\n ([overview](/docs/tutorials/admob_test-new-ad-format-adoption_solution-overview) \\|\n [implementation](/docs/tutorials/admob_test-new-ad-format-adoption_implementation-guide)).\n\n - *Optimize ad frequency*\n ([overview](/docs/tutorials/optimize-ad-frequency/solution-overview) \\|\n [implementation](/docs/tutorials/optimize-ad-frequency))."]]