共用別名
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
使用 Google Ads API 時,有多個地方會使用電子郵件地址進行聯絡和存取權管理,其中最重要的包括:
- Google Ads API 聯絡電子郵件地址:這是 Google Ads 使用者介面 API 中心列為聯絡人的電子郵件地址。
- Google Cloud 控制台帳戶電子郵件地址:這個電子郵件地址必須具備 Google Cloud 控制台帳戶的管理員存取權,該帳戶用於 OAuth 2.0 應用程式。
- Google Ads 管理員帳戶電子郵件地址:這些電子郵件地址在您透過 Google Ads API 存取的管理員 Google Ads 帳戶中,具有管理員權限。為應用程式產生重新整理權杖時,您通常會使用其中一個電子郵件地址驗證 Google Ads API 應用程式。
強烈建議使用共用團隊別名,以免團隊成員調動或離職時,您無法存取這些帳戶。本指南的其餘部分會詳細說明先前列出的每封電子郵件,以及如何更新這些電子郵件,改用共用團隊別名,而非個別使用者的電子郵件地址。
Google Ads API 聯絡電子郵件地址是您註冊 Google Ads API 時提供的電子郵件地址。請務必確保能存取這個別名,並定期查看寄到這個地址的電子郵件。Google 會在 API 審查、稽核要求或需要立即處理的正式版緊急狀況期間,透過這個電子郵件地址與您的團隊聯絡。請使用共用團隊別名做為聯絡電子郵件,確保整個團隊都能收到這些通知。
如要更新 API 聯絡電子郵件地址,請按照下列步驟操作:
登入 Google Ads 管理員帳戶。
按一下畫面左下方的「管理」。
在「管理員帳戶設定」下方,按一下「API 中心」。
在「開發人員詳細資料」下方,記下 API 聯絡電子郵件地址。按一下向下箭頭,然後編輯電子郵件。按一下「儲存」。
Google Cloud 控制台帳戶
Google API 控制台專案包含應用程式的 OAuth 憑證,並控管 Google Ads API 的存取權。請讓帳戶擁有者將共用別名設為這個帳戶,確保您能存取該帳戶。
如要更新 Google API 控制台專案擁有者,請按照下列步驟操作:
- 登入 Google API 控制台。
- 從頁面左上角的下拉式選單中選取專案。
- 從左側選單前往「IAM 與管理」>「IAM」。
- 按一下「授予存取權」按鈕。
- 在「新增主體」部分下方,輸入共用電子郵件地址。
- 指派「擁有者」角色。
- 點選「儲存」按鈕。如要進一步瞭解如何授予及撤銷存取權,請參閱 Cloud 說明文件。
Google Ads 管理員帳戶
使用 Google Ads API 管理帳戶的常見方法,是將所有帳戶連結至同一個管理員帳戶,然後使用最上層管理員帳戶的憑證,對所有帳戶發出 API 呼叫。在這項設定中:
- 開發人員會使用有權存取 Google Ads 管理員帳戶的使用者憑證,核發重新整理權杖。
- 開發人員會將
login_customer_id
標頭設為 Google Ads 管理員帳戶的客戶 ID,並將 customer_id
標頭設為要對其發出 API 呼叫的帳戶客戶 ID。
這種設定方式的潛在風險之一是,如果授權使用者無法再存取 Google Ads 管理員帳戶,重新整理權杖就會失效,所有 API 呼叫都會失敗。為避免發生這種情況,您可以邀請共用的電子郵件別名,以適當的存取層級管理這個 Google Ads 管理員帳戶。
使用這個共用電子郵件別名發出重新整理權杖,以便進行 API 呼叫。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-05 (世界標準時間)。
[null,null,["上次更新時間:2025-09-05 (世界標準時間)。"],[[["\u003cp\u003eWhen working with the Google Ads API, ensure continuous access by using shared team aliases for contact, access management, and authentication purposes instead of individual user emails.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Ads API contact email is used for crucial communications, update it to a shared alias to keep your team informed about API reviews, audit requests, and production emergencies.\u003c/p\u003e\n"],["\u003cp\u003eSafeguard your Google Cloud Console account by granting ownership to a shared team alias, ensuring access to your application's OAuth credentials and control over API access.\u003c/p\u003e\n"],["\u003cp\u003eFor managing multiple Google Ads accounts, link them under a manager account and grant access to a shared alias for refresh token generation and uninterrupted API functionality.\u003c/p\u003e\n"],["\u003cp\u003eRegularly monitor and update these email addresses and access levels to maintain seamless API operations and avoid disruptions caused by personnel changes.\u003c/p\u003e\n"]]],[],null,["# Shared aliases\n\nWhen working with the Google Ads API, there are multiple places where email addresses\nare used for contact and access management, the most important of which are the\nfollowing:\n\n- **Google Ads API contact email**: This is the email listed as the contact in the API Center of the Google Ads UI.\n- **Google Cloud Console account email**: This is the email that has administrator access to the Google Cloud Console account used for your OAuth 2.0 application.\n- **Google Ads manager account email(s)**: These are the emails that have administrator permissions on the manager Google Ads account(s) you access through the Google Ads API. When you generate a refresh token for your application, you usually authenticate your Google Ads API application with one of these emails.\n\nWe strongly recommend using shared team aliases so that you don't lose access to\nthese accounts when individual team members switch teams or leave the company.\nThe rest of this guide elaborates on each of the emails listed earlier and how\nyou can update it to use a shared team alias instead of an individual user's\nemail address.\n\nGoogle Ads API contact email\n----------------------------\n\nThe Google Ads API contact email is an email address you provide when signing up for\nthe Google Ads API. You should ensure access to this alias and monitor emails sent to\nthis address regularly. Google uses this email address to contact your team\nduring API reviews, audit requests, or production emergencies that require\nimmediate attention. Use a shared team alias as the contact email to ensure that\nthe whole team receives these notifications.\n\nFollow these steps to update the API contact email:\n\n1. Sign in to your Google Ads [Manager\n Account](//ads.google.com/home/tools/manager-accounts/).\n\n2. Click **Admin** at the bottom left of the screen.\n\n3. Under **Manager account settings** , click **API center**.\n\n4. Under **Developer details** , note the API contact email. Click the down arrow\n and edit the email. Click **Save**.\n\nGoogle Cloud Console account\n----------------------------\n\nThe **Google API Console** project contains your application's OAuth credentials\nand controls access to the Google Ads API. Ensure access to this account by making a\nshared alias the account owner.\n\nFollow these steps to update the Google API Console project's owner:\n\n- Sign in to [**Google API Console**](//console.developers.google.com).\n- Select your project from the drop-down menu on the top-left corner of the page.\n- Navigate to **IAM and admin \\\u003e IAM** from the left menu.\n- Click the **Grant Access** button.\n- Enter the shared email address under the **Add principals** section.\n- Assign the **Owner** role.\n- Click the **Save** button. Refer to the Cloud documentation to learn more about [granting and revoking access](//cloud.google.com/iam/docs/granting-changing-revoking-access#single-role).\n\nGoogle Ads manager account\n--------------------------\n\nA common method of managing accounts using the Google Ads API is to link all your\naccounts under a common manager account, and make API calls to all the accounts\nusing the top-most manager account's credentials. In this configuration:\n\n- The developer issues a refresh token using the credentials of a user who has access to the Google Ads manager account.\n- The developer sets the [`login_customer_id`](/google-ads/api/docs/get-started/select-account#user_access_login_customer_id_and_customer_id) header as the customer ID of the Google Ads manager account, and the `customer_id` header as the customer ID of the account to which API calls are made.\n\nOne potential risk of this setup is that if the authorized user loses access to\nthe Google Ads manager account, the refresh token is no longer valid and all API\ncalls fail. To avoid this scenario, you can invite a shared email alias to\nmanage this Google Ads manager account with the [appropriate access levels](//support.google.com/google-ads/answer/9978556).\nUse this shared email alias to issue the refresh token for making API calls."]]