Giờ đây, khi đã triển khai các đơn vị quảng cáo mới trong ứng dụng, bạn cần thiết lập thử nghiệm A/B để hiểu được hiệu suất của các đơn vị quảng cáo này. Bạn sẽ xác định
người dùng nào cần nhắm mục tiêu trong thử nghiệm cũng như mục tiêu thử nghiệm của bạn. Bạn cũng sẽ
cần xác định các biến thể thử nghiệm (các đơn vị quảng cáo khác nhau trong ứng dụng của bạn) và đặt
Tham số Remote Config sẽ kiểm soát việc hiển thị
trong ứng dụng của mình.
Firebase A/B Testing sử dụng các sản phẩm sau để kiểm tra và phân tích
tác động của việc thêm đơn vị quảng cáo vào ứng dụng của bạn:
Firebase A/B Testing (bước này) – xác định mục tiêu và có thể định cấu hình
tham số cho thử nghiệm của bạn
Firebase Remote Config (bước tiếp theo) — thêm logic vào mã để xử lý
cấu hình của các thông số
Google Analytics (chạy ngầm) — đo lường tác động của
cấu hình
Bắt đầu một thử nghiệm A/B mới
Để bắt đầu một thử nghiệm có kiểm soát nhằm tối ưu hoá tần suất quảng cáo, hãy bắt đầu bằng cách chuyển đến phần A/B Testing của bảng điều khiển Firebase. Nhấp vào Tạo
thử nghiệm, rồi chọn Remote Config.
Giao diện người dùng của bảng điều khiển của Firebase cho thấy cách bắt đầu một thử nghiệm A/B bằng Remote Config"
class="screenshot">
Thiết lập thông tin cơ bản
Trong phần Cơ bản, hãy xác định tên thử nghiệm và cung cấp
phần mô tả thử nghiệm.
Giao diện người dùng của bảng điều khiển của Firebase cho thấy cách thiết lập thông tin cơ bản cho thử nghiệm A/B"
class="screenshot">
Thiết lập tiêu chí nhắm mục tiêu
Trong phần Nhắm mục tiêu, hãy chọn ứng dụng iOS hoặc Android mà
thử nghiệm sẽ nhắm đến.
Đặt tỷ lệ phần trăm người dùng sẽ mà bạn muốn áp dụng thử nghiệm này. Trong hướng dẫn này, 30% người dùng sẽ được thử nghiệm với các đơn vị quảng cáo mới. Xin lưu ý rằng điều này không có nghĩa là 30% tất cả người dùng sẽ nhìn thấy các đơn vị quảng cáo mới có giới hạn tần suất tăng lên; mà có nghĩa là 30% người dùng sẽ tiếp xúc với 2 quảng cáo xen kẽ mới cùng với đơn vị quảng cáo cơ sở (quảng cáo hiện có của bạn).
Giữ nguyên tất cả các chế độ cài đặt khác theo mặc định.
Giao diện người dùng của bảng điều khiển của Firebase cho thấy cách thiết lập tiêu chí nhắm mục tiêu của thử nghiệm A/B"
class="screenshot">
Thiết lập mục tiêu
Firebase A/B Testing theo dõi một chỉ số chính để xác định chiến thắng
biến thể, mà còn cho phép bạn thêm các chỉ số phụ để hiểu
tác động của các cấu hình khác nhau đến các yếu tố quan trọng khác đối với ứng dụng của bạn.
Đối với hướng dẫn này, hoạt động tối ưu hoá Doanh thu AdMob ước tính là phương pháp chính
mục tiêu, vì vậy, hãy chọn mục tiêu
từ trình đơn thả xuống.
(Không bắt buộc) Nếu bạn muốn A/B Testing theo dõi các chỉ số bổ sung, chẳng hạn như
Tổng doanh thu ước tính hoặc các tỷ lệ giữ chân khác, hãy chọn những tỷ lệ đó theo
nhấp vào Thêm chỉ số.
Giao diện người dùng của bảng điều khiển của Firebase cho thấy cách thiết lập mục tiêu của thử nghiệm A/B"
class="screenshot">
Thiết lập biến thể
Bước cuối cùng của quá trình định cấu hình thử nghiệm A/B là xác định Remote Config
kiểm soát đơn vị quảng cáo nào sẽ được hiển thị cho người dùng.
Trong phần Biến thể, hãy tạo một thông số mới có tên là
INTERSTITIAL_AD_KEY bằng cách nhập tham số này vào trường Thông số của
Thẻ cơ sở.
Hoàn tất việc thiết lập mục Biến thể bằng cách sử dụng các chế độ cài đặt sau cho tham số INTERSTITIAL_AD_KEY:
Biến thể cơ sở: Giá trị được đặt thành mã đơn vị quảng cáo của quảng cáo hiện tại
có cài đặt giới hạn tần suất là 4 lượt hiển thị cho mỗi người dùng trên mỗi 10
phút
Biến thể Biến thể A: Giá trị được đặt thành mã đơn vị quảng cáo của đơn vị quảng cáo mới với chế độ cài đặt giới hạn tần suất là 6 lượt hiển thị cho mỗi người dùng trong mỗi 10 phút
Biến thể Biến thể B: Giá trị được đặt thành mã đơn vị quảng cáo của đơn vị quảng cáo mới với chế độ cài đặt giới hạn tần suất là 8 lượt hiển thị cho mỗi người dùng trong mỗi 10 phút
Trong hướng dẫn này, biến thể Baseline sẽ hiển thị đơn vị quảng cáo hiện có
(4 lượt hiển thị cho mỗi người dùng trong mỗi 10 phút). Biến thể A và Biến thể B sẽ
hiển thị các đơn vị quảng cáo mới (6 và 8 lần hiển thị cho mỗi người dùng trong mỗi 10 phút,
tương ứng) cho một nhóm nhỏ người dùng. Giá trị này được kiểm soát bởi giá trị của tham số là mã đơn vị quảng cáo lấy từ giao diện người dùng AdMob. Các
các giá trị tham số được đặt tại đây trong Firebase A/B Testing, nhưng thực tế
Firebase Remote Config sẽ gửi các giá trị này đến mã của ứng dụng để
xử lý. Bạn sẽ thiết lập Remote Config trong bước tiếp theo.
Giao diện người dùng của bảng điều khiển Firebase cho biết cách thiết lập các biến thể của thử nghiệm A/B"
class="screenshot">
Nhấp vào Xem xét để đảm bảo thử nghiệm của bạn đã được thiết lập như mong đợi. Tuy nhiên,
trước khi có thể bắt đầu thử nghiệm, bạn cần xác định cách ứng dụng của mình
sẽ tương tác với các giá trị thông số nhận được từ Firebase. Tiếp tục đến
bước tiếp theo để triển khai cách Remote Config xử lý INTERSTITIAL_AD_KEY
.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["Step 2: Set up an A/B test in the Firebase console\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------|\n| Introduction: [Optimize AdMob ad frequency using Firebase](/docs/tutorials/optimize-ad-frequency) |\n| Step 1: [Use AdMob to create new ad unit variants for testing](/docs/tutorials/optimize-ad-frequency/step-1) |\n| **Step 2: Set up an A/B test in the Firebase console** \u003cbr /\u003e |\n| Step 3: [Handle Remote Config parameter values in your app's code](/docs/tutorials/optimize-ad-frequency/step-3) |\n| Step 4: [Start the A/B test and review the test results in the Firebase console](/docs/tutorials/optimize-ad-frequency/step-4) |\n| Step 5: [Decide whether to roll out the new ad format](/docs/tutorials/optimize-ad-frequency/step-5) |\n\n\u003cbr /\u003e\n\nNow that you have new ad units implemented in your app, you need to set up an\nA/B test that will help you understand how these ad units perform. You'll define\nwhich users to target in the test as well as your testing goals. You'll also\nneed to define your test variants (the different ad units in your app) and set\nup the Remote Config parameter which will control the display of the\nvariants in your app.\n\nFirebase A/B Testing utilizes the following products to test and analyze the\neffects of adding an ad unit to your app:\n\n- Firebase A/B Testing (this step) --- define goals and configurable parameters for your test\n- Firebase Remote Config (next step) --- add logic to your code to handle the configuration of the parameters\n- Google Analytics (runs behind the scenes) --- measures the impact of the configurations\n\n**Initiate a new A/B test**\n\nTo initiate a controlled test for optimizing ad frequency, start by navigating\nto the *A/B Testing* section of the Firebase console. Click **Create\nexperiment** , then select **Remote Config**.\nFirebase console UI showing how to start an A/B test using Remote Config\" class=\"screenshot\"\\\u003e\n\n**Set up the basics**\n\nIn the *Basics* section, define the experiment name and provide the\nexperiment description.\nFirebase console UI showing how to set up the basics of A/B test\" class=\"screenshot\"\\\u003e\n\n**Set up targeting**\n\n1. In the *Targeting* section, select the iOS or Android app that the\n experiment will target.\n\n2. Set the percentage of users who will be exposed to the experiment. For this\n tutorial, the new ad units will be tested with 30% of your users. Note that\n this doesn't mean that 30% of all your users will see the new ad units with\n increased frequency caps; this means that 30% of your users will be exposed\n to the two new interstitial ads along with the baseline ad unit (your\n existing ad).\n\n Leave all other settings as their defaults.\n\nFirebase console UI showing how to set up the targeting of A/B test\" class=\"screenshot\"\\\u003e **Note:** Due to the different user behavior patterns observed from iOS and Android users, each A/B test can only target either the iOS or Android version of your app.\n|\n| To run the same test for both versions of your app, set up an experiment\n| for one version of your app, then duplicate the test settings in a second\n| experiment. In this second experiment, select the other version of your app\n| in the *Targeting* section.\n\n**Set up your goals**\n\nFirebase A/B Testing tracks a primary metric to determine the winning\nvariant, but it also allows you to add secondary metrics to understand the\nimpacts of different configurations on other important factors for your app.\n\n1. For this tutorial, *Estimated AdMob revenue* optimization is the primary\n goal, so select it from the dropdown menu.\n\n2. *(Optional)* If you want A/B Testing to track additional metrics, like\n *Estimated total revenue* or different retention rates, select those by\n clicking **Add metric**.\n\nFirebase console UI showing how to set up the goals of A/B test\" class=\"screenshot\"\\\u003e\n\n**Set up the variants**\n\nThe last step of configuring an A/B test is defining a Remote Config\nparameter that controls which ad unit will be shown to users.\n\n1. In the *Variants* section, create a new parameter named\n `INTERSTITIAL_AD_KEY` by typing it in the *Parameter* field of the\n *Baseline* card.\n\n2. Finish setting up the *Variants* section using the following settings\n for the `INTERSTITIAL_AD_KEY` parameter:\n\n - ***Baseline*** variant: *Value* set to the ad unit ID of the existing ad unit with the frequency cap setting of 4 impressions per user per 10 minutes\n - ***Variant A*** variant: *Value* set to the ad unit ID of the new ad unit with the frequency cap setting of 6 impressions per user per 10 minutes\n - ***Variant B*** variant: *Value* set to the ad unit ID of the new ad unit with the frequency cap setting of 8 impressions per user per 10 minutes\n\n For this tutorial, the *Baseline* variant will show the existing ad unit\n (4 impressions per user per 10 minutes). *Variant A* and *Variant B* will\n show the new ad units (6 and 8 impressions per user per 10 minutes,\n respectively) to a small subset of users. This is controlled by the\n parameter's value which is the ad unit ID taken from the AdMob UI. These\n parameter values are set here in Firebase A/B Testing, but it's actually\n Firebase Remote Config that sends these values to your app's code for\n handling. You'll set up Remote Config in the next step.\n | **Note:** In your own future tests, if you set up various experiments and variants, we recommend giving variants meaningful names to easily track the test results later on.\n\nFirebase console UI showing how to set up the variants of A/B test\" class=\"screenshot\"\\\u003e\n\nClick **Review** to make sure your experiment is set up as expected. However,\nbefore you can actually start the experiment, you need to define how your app's\ncode will react to the parameter values received from Firebase. Proceed to the\nnext step to implement how Remote Config handles the `INTERSTITIAL_AD_KEY`\nparameter.\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n[arrow_back_ios**Step 1** : Use AdMob to create new ad unit variants](/docs/tutorials/optimize-ad-frequency/step-1)\n[**Step 3** : Handle Remote Config parameter valuesarrow_forward_ios](/docs/tutorials/optimize-ad-frequency/step-3)\n\n\u003cbr /\u003e\n\n*** ** * ** ***"]]