教學課程:利用 AdMob、Google Analytics (分析) 和 Firebase 改善混合型營利策略
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
步驟 2:設定 Google Analytics
Google Analytics 會收集並分析使用者的相關資訊,方便您
協助您鎖定特定使用者群組,提供更貼近個人需求的應用程式體驗。
應用程式內的廣告體驗
在應用程式中新增 Google Analytics for Firebase SDK
若要搭配 AdMob 和 Firebase 使用 Google Analytics,您必須新增
將 Google Analytics for Firebase SDK 導入應用程式的程式碼集。
這個 SDK 會自動記錄特定事件和使用者維度。你不是
需要新增任何程式碼才能啟用Google Analytics 會將這項資料用於
將使用者區隔為目標對象
請注意,應用程式應具備以下應用程式的 Google Mobile Ads (AdMob) SDK:
先前的步驟
Swift
在 Podfile 中新增並安裝 Google Analytics for Firebase Pod:
pod 'Firebase/Analytics'
Android
將 Google Analytics for Firebase 程式庫依附元件新增至
build.gradle
檔案:
implementation 'com.google.firebase:firebase-analytics:23.0.0'
飄逸袖
在 Flutter 專案的根目錄中執行下列指令,以安裝
Google Analytics for Firebase 外掛程式:
flutter pub add firebase_analytics
Unity
下載並安裝最新版本
Firebase Unity SDK,然後
將 Google Analytics for Firebase 套件加進專案:
FirebaseAnalytics.unitypackage
瞭解 Google Analytics 目標對象
您可以透過 Google Analytics 將使用者區隔為「目標對象」,
屬性相同的使用者群組指定目標對像中的所有使用者
在您的應用程式中表現出相同的行為 (例如,在
購物車),和/或分享客層或其他描述性資料 (例如年齡)
範圍)。
Google Analytics 會自動提供「購買者」為「預設目標對象」
常見應用方式曾完成應用程式內購或電子商務購物的使用者
就會納入這個目標對像中
使用混合型營利策略時,您「不」會在應用程式內放送廣告
向曾購物的使用者放送廣告你可以透過這個 Google Analytics
「購買者」的目標對象即可設定Firebase Remote Config
下列 Google Analytics 資源有助您進一步瞭解目標對象:
在本教學課程的下一個步驟中,您將利用「購買者」中的目標對象
正在設定 Firebase Remote Config。
arrow_back_ios步驟 1:使用 AdMob 建立新的多媒體廣告廣告單元
步驟 3:設定 Remote Config 以顯示特定廣告體驗
arrow_forward_ios
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-03 (世界標準時間)。
[null,null,["上次更新時間:2025-09-03 (世界標準時間)。"],[],[],null,["Step 2: Set up Google Analytics\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------|\n| Introduction: [Optimize hybrid monetization using AdMob, Google Analytics, and Firebase](/docs/tutorials/optimize-hybrid-monetization) |\n| Step 1: Use AdMob to create new ad units for display |\n| **Step 2: [Set up Google Analytics](/docs/tutorials/optimize-hybrid-monetization/step-2)** \u003cbr /\u003e |\n| Step 3: [Set up Firebase Remote Config to show specific ads experiences](/docs/tutorials/optimize-hybrid-monetization/step-3) |\n\n\u003cbr /\u003e\n\nGoogle Analytics collects and analyzes information about your users, which can\nhelp you target specific groups of users with more customized app experiences ---\nin this case, their in-app ads experience.\n\n**Add the Google Analytics for Firebase SDK to your app**\n\nTo use Google Analytics with AdMob and Firebase, you need to add the\nGoogle Analytics for Firebase SDK to your app's codebase.\n\nThis SDK will automatically log certain events and user dimensions; you don't\nneed to add any code to enable them. Google Analytics will use this data to\nsegment your users into audiences.\n\nNote that your app should already have the Google Mobile Ads (AdMob) SDK from\nthe previous step of this tutorial. \n\nSwift\n\nAdd and install the Google Analytics for Firebase pod in your podfile: \n\n pod 'Firebase/Analytics'\n\nAndroid\n\nAdd the Google Analytics for Firebase library dependency to your\n`build.gradle` file: \n\n implementation 'com.google.firebase:firebase-analytics:23.0.0'\n\nFlutter\n\nFrom the root of your Flutter project, run the following command to install\nthe Google Analytics for Firebase plugin: \n\n flutter pub add firebase_analytics\n\nUnity\n\nDownload and install the latest\n[Firebase Unity SDK](https://firebase.google.com/download/unity), and then add\nthe Google Analytics for Firebase package to your project: \n\n`FirebaseAnalytics.unitypackage`\n\n**Understand Google Analytics audiences**\n\nUsing Google Analytics, you can segment your users into **audiences**, which are\ngroups of users who share the same attributes. All the users in a given audience\nhave exhibited the same behavior in your app (for example, added an item to\ncart) and/or share demographic or other descriptive data (for example, age\nrange).\n\nGoogle Analytics automatically provides a \"Purchasers\" default audience that's\ncommon for most apps. Any user who has made an in-app purchase or an ecommerce\npurchase will be placed in this audience.\n\nWhen using a hybrid monetization strategy, you do **not** want to show in-app\nads to users who have made a purchase. So you can leverage this Google Analytics\naudience of \"Purchasers\" when you set up Firebase Remote Config.\n\nHere are some Google Analytics resources to learn more about audiences:\n\n- [Introduction to audiences in Google Analytics](https://support.google.com/analytics/answer/12799087)\n\n- [Examples of audiences in Google Analytics and how to create them](https://support.google.com/analytics/answer/12799863)\n\nIn the next step of this tutorial, you'll leverage the \"Purchasers\" audience in\nsetting up Firebase Remote Config.\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n[arrow_back_ios**Step 1** : Use AdMob to create new ad units for display](/docs/tutorials/optimize-hybrid-monetization)\n[**Step 3** : Set up Remote Config to show specific ads experiences\narrow_forward_ios](/docs/tutorials/optimize-hybrid-monetization/step-3)\n\n\u003cbr /\u003e\n\n*** ** * ** ***"]]