透過集合功能整理內容
你可以依據偏好儲存及分類內容。
選擇註冊流程
AFP 整合的重要步驟,是先決定要透過哪個註冊流程來讓使用者加入。註冊的用意是讓使用者建立新的 AdSense 帳戶 (或使用現有的 AdSense 帳戶註冊),並將帳戶連結至平台。您可以從預計投入開發的技術資源,以及希望帶給使用者的新手上路體驗這兩點來考量,選擇合適的註冊流程。
方法 1:無 API 流程
這種方法不使用 API,因此需要投入的技術資源最少,只要有一位網頁程式開發人員為平台建立使用者介面即可。但缺點是使用者必須執行較多步驟,才能完成註冊流程。
無 API 註冊流程總覽

導入作業
如要導入無 API 註冊流程,您必須為 AdSense 營利功能提供 UI 元件。例如,在使用者存取「帳戶設定」或「使用者個人資料」的頁面中,新增包含以下項目的營利資訊頁面:
- 簡要說明 AdSense 及其與平台的互動方式。使用者應完全知悉自己即將註冊新的 AdSense 帳戶或使用現有的 AdSense 帳戶。
- AdSense 計畫政策相關資訊。所有註冊的使用者都應該瞭解 AdSense 計畫及其政策規定。
- 使用者將獲得的收益分潤。請務必向使用者明確列出您將分得的 AdSense 收益百分比,以及發布商將分得的收益百分比。AdSense 會在新手上路流程中再次顯示這項資訊。
- 「連結 AdSense」按鈕。這個按鈕會開啟一個新分頁,將使用者帶往 AdSense 中的相應頁面 (無論他們是否已有 AdSense 帳戶)。
自訂網址範例:
https://adsense.google.com/adsense/signup?url={platform-site-url}
注意:Google 會提供自訂註冊頁面網址,並協助您定義網址變數的內容。
- 用於收集和儲存使用者 AdSense 發布商 ID 的輸入框。使用者進入上述連結頁面後,必須複製發布商 ID 並貼進此輸入框。
重要事項:請務必確實儲存使用者的發布商 ID,以便為使用者的內容頁面標記正確的發布商資訊。詳情請參閱「將廣告代碼加入網頁」一節。
請務必檢查已輸入的字串。發布商 ID 的格式為:pub-1234567890987654
如果是在規則運算式字詞中,則為:pub\-\d{16}
重要事項:有些 AdSense 使用者貼上發布商 ID 後,可能會忘記點擊「連結 AdSense」按鈕。請務必提醒使用者,其 AdSense 帳戶的「網站」頁面中必須列有平台網域,廣告才能順利放送。這個按鈕最主要的用途就在這裡。
- 使用者的標記狀態。使用者會想知道自家網頁是否已放置廣告程式碼,因此不妨在使用者體驗中,讓使用者知道您已使用他們的 AdSense 發布商 ID 標記好網頁。此外,您也可以填入子帳戶的 Meta 標記,這有助於 AdSense 進行網站驗證步驟。這樣一來,您就無須代替使用者在網頁上發布廣告代碼。
方法 2:半輔助式 API 流程
這種方法會使用 AdSense Management API,可稍微簡化註冊流程。這種方法需要投入較多技術資源,但可減少使用者必須完成的 AdSense 註冊步驟。
半輔助式 API 流程總覽

導入作業
如要透過 API 導入半輔助註冊流程,您必須為 AdSense 營利功能提供 UI 元件。例如,在使用者存取「帳戶設定」或「使用者個人資料」的頁面中,新增包含以下項目的營利資訊頁面:
- 簡要說明 AdSense 及其與平台的互動方式。使用者應完全知悉自己即將註冊新的 Google AdSense 帳戶或使用現有的 AdSense 帳戶。
- AdSense 計畫政策相關資訊。所有註冊的使用者都應該瞭解 AdSense 計畫及其政策規定。
- 使用者將獲得的收益分潤。請務必向使用者明確列出您將分得的 AdSense 收益百分比,以及發布商將分得的收益百分比。AdSense 會在新手上路流程中再次顯示這項資訊。
- 「連結 AdSense」按鈕。此按鈕可授權您以平台身分使用 AdSense Management API 存取 AdSense 客戶的帳戶資訊。請按照開發人員文件的操作說明進行設定。您可以使用這個 API 進行接下來兩個步驟。
- 使用 AdSense Management API 收集使用者的 AdSense 發布商 ID。請務必檢查已輸入的字串。
發布商 ID 的格式為:pub-1234567890987654
如果是在規則運算式字詞中,則為:pub\-\d{16}
重要事項:請務必確實儲存使用者的發布商 ID,以便為使用者的內容頁面標記正確的發布商資訊。詳情請參閱「將廣告代碼加入網頁」一節。
- 使用 AdSense Management API 檢查使用者是否已將平台網站加入他們的 AdSense 帳戶。如果未加入,請要求使用者按照下列連結完成設定。您在 API 中應檢查的網站名稱是下列連結的
{platform-site-url}
變數。
https://adsense.google.com/adsense/signup?url={platform-site-url}
注意:Google 會提供自訂註冊頁面網址,並協助您定義 url 變數的內容。
- - 使用者的標記狀態。使用者會想知道自家網頁是否已放置廣告程式碼,因此不妨在使用者體驗中,讓使用者知道您已使用他們的 AdSense 發布商 ID 標記好網頁。此外,您也可以填入子帳戶的 Meta 標記,這有助於 AdSense 進行網站驗證步驟。這樣一來,您就無須代替使用者在網頁上發布廣告代碼。
選項 3:嵌入式連線
嵌入式 Connect 可讓您輕鬆處理不同狀態的 AdSense 帳戶,根據特定使用者 AdSense 帳戶的帳戶、廣告客戶和網站狀態,嵌入式 Connect 流程會為每位使用者提供客製化新手上路體驗,讓您不必自行處理。

導入方式包括 JavaScript 程式庫、空白 div (AdSense 會在其中顯示註冊小工具),以及一些回呼函式,可在使用者完成註冊流程後儲存發布商 ID。您可以輔助使用 AdSense Management API 來提升使用體驗,例如擷取廣告單元或自動廣告的狀態。
進一步瞭解 Embedded Connect
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
[null,null,[],[[["\u003cp\u003eAdSense for Platforms (AFP) offers three signup flow options to onboard users, each with varying technical requirements and user experiences.\u003c/p\u003e\n"],["\u003cp\u003eThe API-less flow is the simplest to implement but requires more user steps; the Semi-assisted API flow utilizes the AdSense Management API for a smoother experience; and Embedded Connect provides a fully customized and automated signup process.\u003c/p\u003e\n"],["\u003cp\u003eAll signup flows necessitate clear communication with users about AdSense policies, revenue share, and tagging status, ensuring transparency and understanding.\u003c/p\u003e\n"],["\u003cp\u003eRegardless of the chosen flow, securely storing the user's AdSense Publisher ID is crucial for proper ad serving and revenue tracking.\u003c/p\u003e\n"],["\u003cp\u003eAFP provides flexibility for platforms to tailor the signup experience to their specific needs and technical capabilities while adhering to AdSense guidelines.\u003c/p\u003e\n"]]],["The document outlines three signup flows for integrating AdSense into a platform. The API-less flow requires users to manually connect their AdSense account via a link and input their publisher ID. The semi-assisted API flow utilizes the AdSense Management API to retrieve the user's publisher ID and check their site status, reducing user steps. Embedded Connect, a third option, uses a JavaScript library for a streamlined experience and handles complex account states automatically. All options involve displaying AdSense policies and revenue sharing information.\n"],null,["Choose a sign up flow\n---------------------\n\nAn important decision with AFP is to choose a sign up flow to onboard your users. The purpose of the sign up is to allow your users to create a new AdSense account (or sign in to an existing AdSense account) and link it to your platform. The option you choose will depend on the technical resources you want to invest in development and the onboarding experience you want to provide for your users.\n\n### Option 1: API-less flow\n\nOption 1 requires the fewest technical resources as it doesn't use an API. You will only need a web developer to build the user interface within your platform. However, the trade-off is that this option requires your users to take more steps to complete the signup flow.\n\n#### Overview of the API-less signup flow\n\n#### Implementation\n\nTo implement an API-less signup flow, you need to provide a UI component for AdSense monetization. For example, on the page where your users access their \"user profile\" or \"account settings\", add a monetization page that includes the following:\n\n- A short description of AdSense and how it interacts with your platform. Users should be completely aware that they're either signing up for a new AdSense account or using their existing AdSense account.\n- Information about the [AdSense Program policies](https://support.google.com/adsense/answer/48182). All users who sign up should be aware of the AdSense Program and its policies.\n- The revenue share that your users will receive. It's important to explicitly show users what percentage of the AdSense revenue you will keep and what percentage the publisher will keep. AdSense will additionally show this information during the onboarding flow.\n- A \"Connect AdSense\" button. This button will open a new tab and take the user to the correct page in AdSense depending on whether or not they have an existing AdSense account. \n Example custom URL: \n `https://adsense.google.com/adsense/signup?url={platform-site-url}` \n **Note:** Google will provide you with the URL of the custom signup page, and help you define the contents of the URL variable.\n- An input box to collect and store the user's AdSense publisher ID. After a user visits the link above, they will need to copy and paste their publisher ID into this input box. \n **Important:** It's critical that you store the user's publisher ID so that you can tag the user's content pages with the correct publisher information. See the [Add the ad tag to your pages](/adsense/platforms/transparent/ad-tags) for more information. \n Make sure you validate the inputted string. The format of a publisher ID is: `pub-1234567890987654` \n Or in regex terms: `pub\\-\\d{16}` \n **Important:** Some AdSense users may paste their publisher ID without clicking on the \"Connect AdSense\" button. It's important to let users know that the **Sites** page in their AdSense account needs to have the platform domain listed before ads can be served. This is the primary purpose of this button.\n- The user's tagging status. Users will want to know whether their ad code has been placed on their pages or not. As part of the user experience, let your users know when you've tagged their pages with their AdSense publisher ID. You can additionally populate the [child account meta tag](/adsense/platforms/transparent/meta-tags#child_account) which will assist AdSense during the site verification steps. This also removes the need to publish ad tags on their pages on the user's behalf.\n\n### Option 2: Semi-assisted API flow\n\nOption 2 uses the [AdSense Management API](https://developers.google.com/adsense/management) to slightly simplify the signup flow. It requires more technical resources but reduces the number of steps your users need to take to sign up for AdSense.\n\n#### Overview of the semi-assisted API flow\n\n#### Implementation\n\nTo implement a semi-assisted signup flow with an API, you need to provide a UI component for AdSense monetization. For example, on the page where your users access their \"user profile\" or \"account settings\", add a monetization page that includes the following:\n\n- A short description of AdSense and how it interacts with your platform. Users should be completely aware that they are signing up for a Google AdSense account, or using their existing AdSense account.\n- Information about the [AdSense Program policies](https://support.google.com/adsense/answer/48182). All users who sign up should be aware of the AdSense Program and its policies.\n- The revenue share that your users will receive. It's important to explicitly show users what percentage of the AdSense revenue you will keep and what percentage the publisher will keep. AdSense will additionally show this information during the onboarding flow.\n- A \"Connect AdSense\" button. This button will authorize you as the platform to access an AdSense customer's account information using the [AdSense Management API](https://developers.google.com/adsense/management). Please follow the instructions on our developer documentation to set this up. Using this API you can perform the next two steps.\n- Use the AdSense Management API to collect the user's AdSense publisher ID. Make sure you validate the inputted string. \n The format of a publisher ID is: `pub-1234567890987654` \n Or in regex terms: `pub\\-\\d{16}` \n **Important:** It's critical that you store the user's publisher ID so that you can tag the user's content pages with the correct publisher information. See the See the [Add the ad tag to your pages](/adsense/platforms/transparent/ad-tags) for more information.\n- Use the AdSense Management API to check if the user has added the platform site to their AdSense account. If not, ask the user to follow the link below to complete the set up. The name of the site you should check for in the API is the `{platform-site-url}` variable in the link below. \n `https://adsense.google.com/adsense/signup?url={platform-site-url}` \n **Note:** Google will provide you with the URL of the custom signup page, and help you define the contents of the url variable.\n- - The user's tagging status. Users will want to know whether their ad code has been placed on their pages or not. As part of the user experience, let your users know when you've tagged their pages with their AdSense publisher ID. You can additionally populate the [child account meta tag](/adsense/platforms/transparent/meta-tags#child_account) which will assist AdSense during the site verification steps. This also removes the need to publish ad tags on their pages on the user's behalf.\n\n### Option 3: Embedded Connect\n\nEmbedded Connect removes all the complexity of dealing with AdSense accounts in different states. Depending on the account, ad client and site statuses for a given user's AdSense account, the Embedded Connect flow will present a customized onboarding experience for each user so that you don't have to.\n\nThe implementation involves a JavaScript library, an empty div where AdSense will render a sign-up widget, and some callback functions which will allow you to save the publisher ID once the user has completed the sign-up flow. You can supplementally use the [AdSense Management API](/adsense/management) to augment the experience, for example by retrieving ad units or the state of Auto ads.\n\n[Learn more about Embedded Connect](/adsense/platforms/transparent/embedded-connect)"]]