Google Ads API 中的大多數服務,都是針對特定 Google Ads 帳戶和廣告活動運作。因此,大多數要求都需要客戶 ID,才能識別您管理或查詢的帳戶,以及有權存取該客戶 ID 的 OAuth 憑證。不過,ReachPlanService
適用於影片規劃活動,您可能在放送廣告活動前,就已知道特定客戶 ID。
如果合作夥伴要為自家機構建構內部使用的工具,我們建議採取下列任一做法:
如果企劃人員無法存取客戶的 Google Ads 帳戶:
使用已安裝的應用程式流程,為有權存取開發人員符記管理員帳戶的使用者產生 OAuth 憑證。然後為使用您工具的每個團隊建立或取得 Google Ads 帳戶,並將這些帳戶連結至管理員帳戶。向 ReachPlanService 提出要求,提供與使用者團隊相應的客戶 ID。
如果規劃人員有權存取管理客戶帳戶的 Google Ads 管理員帳戶:請實作網頁應用程式流程,允許應用程式使用規劃人員的 OAuth 憑證。然後傳入與方案客戶相應的客戶 ID。
如果合作夥伴為外部使用者建構工具,建議採用類似方法:
使用已安裝的應用程式流程,為有權存取開發人員權杖管理員帳戶的使用者產生 OAuth 憑證。為每位外部客戶建立一個 Google Ads 帳戶,然後將這些帳戶連結至管理員帳戶。然後設定工具,在產生規劃時提供客戶的相應客戶 ID。
使用網頁應用程式流程,讓使用者授予工具帳戶存取權。使用者授予權限後,請使用 CustomerService 提供可存取的 Google Ads 帳戶清單。
目標是確保規劃人員在使用 ReachPlanService 時,能盡可能減少阻礙。整合 API 前,請根據情況選擇其中一種做法,並找出幾個客戶 ID 進行測試。如有疑問,請使用工具類型的第一個建議方法。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[[["\u003cp\u003eThe ReachPlanService API requires allowlisted access, an approved developer token, OAuth credentials, and a valid customer ID.\u003c/p\u003e\n"],["\u003cp\u003eYour developer token needs to be specifically allowlisted for ReachPlanService, and you must accept the Google Ads API Terms of Service.\u003c/p\u003e\n"],["\u003cp\u003eCustomer ID selection depends on whether planners have access to client accounts or use a manager account, impacting OAuth credential flow.\u003c/p\u003e\n"],["\u003cp\u003ePartners building internal tools can choose between using a manager account with linked team accounts or leveraging planners' existing manager account access.\u003c/p\u003e\n"],["\u003cp\u003ePartners building external tools can use a similar approach, either linking client accounts to a manager account or utilizing the web application flow for direct user account access.\u003c/p\u003e\n"]]],[],null,["# Authentication\n\n| **Important:** This feature is available to allowlisted accounts only. Contact your Google representative if you need access to the feature.\n\n\u003cbr /\u003e\n\nRequests to the [`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService) must\nsupply an approved developer token, OAuth credentials, and a customer ID that\nyour OAuth credentials can access.\n\nThis guide covers authentication details specific to\n[`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService). If you haven't already,\nfirst complete the steps outlined in [Get\nstarted](/google-ads/api/docs/get-started/introduction), then come back to this point.\n\nDeveloper token and OAuth credentials\n-------------------------------------\n\nIn addition to the guidance presented by [Get\nstarted](/google-ads/api/docs/get-started/introduction), keep the following points in mind:\n\n1. Your developer token must be allowlisted to connect to the [`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService), even if it's already approved for use with other Google Ads API services. For more information, see the [eligibility\n requirements](/google-ads/api/docs/reach-forecasting#eligibility).\n2. You must accept the Google Ads API Terms of Service in order to connect to the Google Ads API.\n3. The user who owns your OAuth refresh token determines which customer IDs you can query in the [`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService). This informs your integration and is explained in more details below.\n\nCustomer IDs\n------------\n\nMost services within the Google Ads API operate on specific Google Ads accounts and\ncampaigns. As a result, most requests require both a customer ID to identify\nthe account you're managing or querying, and [OAuth\ncredentials](/google-ads/api/docs/oauth/overview) that have permission to access that\ncustomer ID. However, [`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService)\nis meant for video planning activities that might occur before you know the\nspecific customer ID where you would run a campaign.\n\nFor partners who build tools for internal use in their organization, we\nrecommend one of the following choices:\n\n1. **If your planners don't have access to your clients' Google Ads accounts** :\n Generate OAuth credentials using the *installed application flow* for a user\n with access to your developer token's manager account. Then create or obtain\n a Google Ads account for each team that uses your tool, and [link them to\n your manager account](//support.google.com/google-ads/answer/7459601). When making requests to\n [`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService) provide the customer ID\n corresponding to a user's team.\n\n2. **If your planners have access to a Google Ads manager account that manages\n your clients' accounts** : Implement the *web application flow* to allow your\n app to use your planners' OAuth credentials. Then you can pass in the\n customer ID corresponding to the customer of your plan.\n\nFor partners who build a tool for external users, we recommend similar\napproaches:\n\n1. Generate OAuth credentials using the *installed application flow* for a user\n with access to your developer token's manager account. Create a Google Ads\n account per external client and [link them to your manager\n account](//support.google.com/google-ads/answer/7459601). Then configure your tool to provide a client's\n corresponding customer ID when they're generating plans.\n\n2. Give your users the ability to grant your tool access to their accounts\n by using the *web application flow* . Once a user grants permission, use the\n [`CustomerService`](/google-ads/api/docs/account-management/listing-accounts) to provide\n them with a list of Google Ads accounts they can access.\n\nThe goal is to ensure planners have the lowest possible friction when using the\n[`ReachPlanService`](/google-ads/api/reference/rpc/v21/ReachPlanService). Before you integrate the\nAPI, select one of the two approaches according to your situation and identify\na few customer IDs to test. If in doubt, use the first suggested approach for\nyour tool type."]]