Firebase 将于 5 月 14 日重返 Google I/O 大会!
立即报名。
撰寫廣告活動
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
事前準備
請務必完成「開始使用」一文中的步驟,確保您已啟用 Firebase 的應用程式,並新增最新版 Firebase In-App Messaging SDK。
建立新廣告系列
在 Firebase 控制台的「訊息」頁面中,設定新的廣告活動。
- 如果您是初次使用,請按一下「建立您的第一個廣告活動」。
- 如果沒有,請按一下「新增廣告活動」。
步驟 1:樣式和內容
在控制台中,使用 Firebase In-App Messaging 訊息範本,將不同功能納入應用程式內訊息,以達到不同目的。
探索用途,查看訊息範本的樣式設定範例。
訊息範本類型 |
功能 |
功能說明 |
資訊卡 |
動態視窗 |
只有圖片 |
橫幅 |
lens |
lens |
lens |
lens |
圖片 |
提供 HTTPS 圖片網址。您可以使用
Firebase Hosting 代管圖片。 |
lens |
lens |
lens |
lens |
動作 |
使用網頁連結或深層連結,將使用者帶往外部網頁或應用程式中的特定頁面。您可以使用 Firebase 動態連結建立及管理深層連結。「範本」強制回應
和「僅限圖片」包含 X 按鈕,可讓使用者關閉訊息。 |
lens |
lens |
|
lens |
文字/背景顏色 |
輸入十六進位顏色代碼或使用顏色漸層,找出符合您品牌的特定色調,自訂訊息視覺效果。 |
lens |
lens |
|
lens |
訊息標題/內文 |
使用相關標題和簡潔的說明,吸引使用者目光。Firebase 會自動翻譯及調整文字大小,以配合使用者的需求。 |
lens |
lens |
|
|
主要按鈕 |
按鈕的預設動作是關閉訊息。提供網址,將使用者重新導向至該網址。 |
lens |
|
|
|
次要按鈕 |
按鈕的預設動作是關閉訊息。提供網址,將使用者重新導向至該網址。 |
在 Firebase 控制台的「撰寫廣告活動」視窗中,使用各範本提供的功能,自訂符合需求的訊息。
在「撰寫廣告活動」視窗右側,預覽訊息在手機或平板電腦上橫向或直向顯示的樣子。
控制台中的預覽畫面可讓您大致瞭解訊息在行動裝置上的呈現方式。系統會依據不同裝置調整實際的訊息顯示方式。使用實體裝置測試,查看確切的顯示效果。
視需要為廣告活動定義自訂中繼資料。向使用者顯示廣告活動時,用戶端可透過 SDK 回呼存取這項中繼資料。舉例來說,您可能想為廣告活動加上促銷代碼,以便在客戶端使用。
步驟 2:指定目標使用者
輸入廣告活動的名稱。
這個名稱會用於廣告活動報表,不會向使用者顯示。
(選用) 提供廣告活動說明。
這項說明會用於廣告活動報表,不會向使用者顯示。
按一下「選取應用程式」下拉式選單,找出要與這個廣告活動建立關聯的應用程式。
(選用) 按一下「和」按鈕,進一步縮小目標使用者範圍。
使用「選取」下拉式選單選擇其他規格。
查看符合這項活動條件的潛在使用者百分比。
這項預估值是根據過去 7 天內曾使用服務的活躍使用者計算得出。只有在觸發相關條件時,符合資格的使用者才會看見這則訊息。
(選用) 如果應用程式的目標使用者使用多種語言,系統會提示您將廣告活動翻譯成這些語言。使用對話方塊新增自己的翻譯,或使用 Google 翻譯輕鬆將廣告活動本地化。
步驟 3:排定郵件傳送時間
說明廣告活動的開始日期和時間。
發布廣告活動或排定開始時間後,廣告活動就會開始放送。
說明廣告活動的結束日期和時間。
廣告活動可以無限期放送,也可以排定結束時間。
按一下「事件 +」,新增至少一個觸發事件。
指定每個裝置的頻率限制。這項限制可讓您控制使用者看到訊息的頻率。
- 根據預設,廣告活動在使用者看過一次 (即曝光) 後,就不會再顯示。
- 或者,你也可以設定訊息的頻率 (以天為單位)。
步驟 4:轉換事件 (選用)
Firebase 會追蹤促成轉換完成事件的曝光次數。
在「撰寫廣告活動」視窗中,使用「選取轉換事件」下拉式選單選擇:
發布廣告活動後,請前往「訊息」頁面,然後點按廣告活動名稱,即可查看廣告活動轉換記錄的相關資料。
發布廣告活動
修改廣告活動後,您可以按一下「另存為草稿」,稍後再返回並編輯處於草稿狀態的廣告活動。
或者,您也可以按一下「發布」,在排定的日期向目標使用者發布訊息。廣告活動發布後,您仍可編輯。
已發布的廣告活動一旦停止,就無法再次發布。
不過,您隨時可以停止或編輯放送中的廣告活動。您也可以複製現有廣告活動,稍做修改,避免從頭建立新的廣告活動。
在 Firebase中透過 Gemini 取得訊息廣告活動的 AI 洞察資料
Gemini in Firebase
提供訊息廣告活動摘要、洞察資料和指引,協助您提升Firebase Cloud Messaging和In-App Messaging廣告活動成效。Gemini in Firebase 可分析廣告活動資料,協助您瞭解廣告活動的觸及率和影響,並建議提升使用者參與度和成長的策略。
存取訊息廣告活動的 AI 洞察資料
如要使用訊息廣告活動 AI 洞察資料,請確認專案符合下列條件:
專案已啟用 Gemini in Firebase。詳情請參閱「在 Firebase 中設定 Gemini」。
Firebase Cloud Messaging 或 In-App Messaging 已在 Firebase 專案中啟用。
至少有一個廣告活動存在,並顯示在 Firebase 控制台中。
確認符合上述規定後,請按照下列步驟操作:
在 Messaging 控制台中開啟,即可存取廣告活動資料。Firebase
載入廣告活動資料後,按一下「產生 AI 洞察資料」。
系統會顯示訊息廣告活動的摘要和分析。
定價
詳情請參閱「Gemini in Firebase 定價」一文。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-17 (世界標準時間)。
[null,null,["上次更新時間:2025-08-17 (世界標準時間)。"],[],[],null,["\u003cbr /\u003e\n\nBefore you begin\n\nMake sure you complete the steps in [Get\nStarted](/docs/in-app-messaging/get-started) to\nensure you have an app with Firebase enabled and have added the latest Firebase In-App Messaging\nSDK.\n\nCreate a new campaign\n\nSet up your new campaign in the Firebase console's\n[Messaging page](https://console.firebase.google.com/project/_/messaging).\n\n- If you are a first time user, click **Create your first campaign**.\n- If not, click **New campaign**.\n\nStep 1: Style and content\n\nIn the console, use Firebase In-App Messaging message templates to incorporate different\nfeatures to serve different purposes with your in-app messages.\n\n[Explore use cases](/docs/in-app-messaging/explore-use-cases) to see\nexamples for stylizing the messages templates.\n\n\n| Message Template Type |||| Feature | Feature Description |\n| Feature | Feature Description |\n|---------|---------------------|------------|--------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Card | Modal | Image only | Banner |\n| lens | lens | lens | lens | Image | Provide an HTTPS Image URL. You can use [Firebase Hosting](/docs/hosting) to host your images. |\n| lens | lens | lens | lens | Action | Use weblinks or deep links to send your users to external pages or specific pages in your app. You can use [Firebase Dynamic Links](/docs/dynamic-links) to create and manage deep links. Templates **Modal** and **Image only** include an X button, allowing users to dismiss the message. |\n| lens | lens | | lens | Text/background color | Customize the message visuals by entering the Hex Color Code or using the color gradient to find the specific hue that matches your brand. |\n| lens | lens | | lens | Message title/body | Catch your user's attention with a relevant header and a concise description. Firebase automatically translates and scales your text to accommodate your users. |\n| lens | lens | | | Primary button | The default button action is set to dismiss the message. Provide a URL to redirect users as the action. |\n| lens | | | | Secondary button | The default button action is set to dismiss the message. Provide a URL to redirect users as the action. |\n\n\u003cbr /\u003e\n\n1. In Firebase console's **Compose campaign** window, customize your\n message to your liking with the features available to each template.\n\n2. On the right-hand side of the **Compose campaign** window, preview your message\n in landscape or portrait orientation for a phone or tablet device.\n\n The in-console preview provides a general idea of how your message appears\n on a mobile device. Actual message rendering varies depending on the device.\n [Test with a real device to see the exact rendering](/docs/in-app-messaging/get-started#send_a_test_message).\n3. If desired, define custom metadata for your campaign. This metadata will be available\n on the client side using SDK callbacks when a campaign is displayed to a user.\n For example, you might want to tag the campaign with a promo code that\n you can use on the client.\n\nStep 2: Target your users\n\n1. Enter a name for your campaign.\n\n This name is used for campaign reporting and is not part of the visible\n message.\n2. (Optional) Provide a campaign description.\n\n This description is used for campaign reporting and is not part of the visible\n message.\n3. Click on the **Select app** dropdown and identify which\n app you want to associate with this campaign.\n\n4. (Optional) Click the **and** button to further narrow down your\n target users.\n\n Use the **Select** dropdown to choose additional specifications.\n5. View the percentage of potential users that are eligible for this\n campaign.\n\n This number is estimated based on active users who contacted the service\n in the last 7 days. Eligible users only see this message if a trigger\n condition occurs.\n6. (Optional) If your app targets users in multiple languages, you will be\n prompted to localize the campaign in those languages. Use the dialog to\n either add your own translations or use Google Translate to localize the\n campaign easily.\n\nStep 3: Scheduling your message\n\n1. Describe a start date and time for your campaign.\n\n Your campaign can start when you publish the campaign or have a scheduled\n start.\n2. Describe an end date and time for your campaign.\n\n Your campaign can run indefinitely or have a scheduled endpoint.\n3. Click Event + to add at least one trigger event.\n\n - You can enter default events or [events logged through Firebase Analytics](/docs/analytics/android/events) to trigger your in-app message. These events can be user actions, system events, or errors.\n - Your in-app message is triggered when any of your events occur.\n4. Specify your per-device frequency limit. The limit allows you to\n control how often your users see your message.\n\n - By default, a campaign is not shown after it has been viewed by (that is, impressed on) the user once.\n - Or, you can set the frequency of messages in days.\n\nStep 4: Conversion events (optional)\n\nFirebase tracks the number of impressions that result in a completed conversion\nevent.\n\n1. In the **Compose campaign** window, use the **Select conversion event**\n dropdown to choose from:\n\n - The default conversion events.\n - Any [events you enabled as conversions](https://support.google.com/firebase/answer/6317522#enable).\n2. After you publish the campaign, go to the\n [Messaging page](https://console.firebase.google.com/project/_/messaging)\n and click on the campaign's name to see data related to the\n campaign's conversion history.\n\nPublishing your campaign\n\nAfter modifying your campaign, you can click **Save as draft** for the option to\nreturn and edit the campaign in draft status.\n\nOr, you can click **Publish** to release your message to targeted users on the\nscheduled date. You can edit your campaign after it has been published.\n\nOnce you stop a published campaign, you will not be able to publish it again.\nHowever, you may stop or edit a running campaign at any time. You can also\nduplicate an existing one to make slight variations and avoid creating a\ncompletely new campaigns.\n\nGet AI insights for messaging campaigns with Gemini in Firebase\n\nGemini in Firebase\nprovides messaging campaign summarization, insights,\nand guidance to improve your Firebase Cloud Messaging and In-App Messaging\ncampaign performance. By analyzing campaign data,\nGemini in Firebase can help you understand your campaigns' reach and impact\nand suggests strategies to improve user engagement and growth.\n\nAccess AI insights for messaging campaigns\n\nTo use messaging campaign AI insights, make sure that your project has the\nfollowing:\n\n- Gemini in Firebase is enabled for your project. Learn more at\n [Set up Gemini in Firebase](/docs/gemini-in-firebase/set-up-gemini).\n\n- Firebase Cloud Messaging or In-App Messaging is enabled in your Firebase\n project.\n\n- At least one campaign exists and appears in the Firebase console.\n\nAfter ensuring these requirements are met:\n\n1. Open [**Messaging**](//console.firebase.google.com/project/_/messaging) in the\n Firebase console to access campaign data.\n\n2. After your campaign data loads, click **Generate AI insights**.\n\n A summary and analysis of your messaging campaigns appears.\n\nPricing\n\nSee\n[Gemini in Firebase pricing](/docs/gemini-in-firebase#pricing) for more\ninformation."]]