บทแนะนํา: เพิ่มประสิทธิภาพการสร้างรายได้รูปแบบผสมโดยใช้ AdMob, Google Analytics และ Firebase
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ขั้นตอนที่ 2: ตั้งค่า Google Analytics
Google Analytics จะรวบรวมและวิเคราะห์ข้อมูลเกี่ยวกับผู้ใช้ของคุณ ซึ่งสามารถ
ช่วยให้คุณกำหนดเป้าหมายกลุ่มผู้ใช้ที่เฉพาะเจาะจงด้วยประสบการณ์การใช้งานแอปที่ปรับแต่งได้มากขึ้น
คือประสบการณ์การใช้งานโฆษณาในแอป
เพิ่ม SDK ของ Google Analytics สําหรับ Firebase ในแอป
หากต้องการใช้ Google Analytics กับ AdMob และ Firebase คุณต้องเพิ่มเมธอด
SDK ของ Google Analytics สำหรับ Firebase ไปยังฐานของโค้ดของแอป
SDK นี้จะบันทึกเหตุการณ์และมิติข้อมูลผู้ใช้บางอย่างโดยอัตโนมัติ เธอไม่ได้
คุณต้องเพิ่มโค้ดใดๆ เพื่อเปิดใช้ Google Analytics จะใช้ข้อมูลนี้เพื่อ
แบ่งกลุ่มผู้ใช้ออกเป็นกลุ่มเป้าหมายต่างๆ
โปรดทราบว่าแอปของคุณควรมี SDK Google Mobile Ads (AdMob) จาก
ขั้นตอนก่อนหน้าของบทแนะนำนี้
Swift
เพิ่มและติดตั้งพ็อด Google Analytics สำหรับ Firebase ในพ็อดไฟล์ด้วยคำสั่งต่อไปนี้
pod 'Firebase/Analytics'
Android
เพิ่มการพึ่งพาไลบรารีของ Google Analytics สำหรับ Firebase ลงใน
build.gradle
ไฟล์:
implementation 'com.google.firebase:firebase-analytics:23.0.0'
Flutter
จากรูทของโปรเจ็กต์ Flutter ให้เรียกใช้คำสั่งต่อไปนี้เพื่อติดตั้ง
ปลั๊กอิน Google Analytics สำหรับ Firebase
flutter pub add firebase_analytics
Unity
ดาวน์โหลดและติดตั้งเวอร์ชันล่าสุด
Firebase Unity SDK แล้วเพิ่ม
แพ็กเกจ Google Analytics สำหรับ 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
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-09-03 UTC
[null,null,["อัปเดตล่าสุด 2025-09-03 UTC"],[],[],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*** ** * ** ***"]]