共享别名
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在使用 Google Ads API 时,有多个地方会使用电子邮件地址进行联系和访问权限管理,其中最重要的是以下几点:
- Google Ads API 联系电子邮件地址:这是 Google Ads 界面的 API 中心内列为联系人的电子邮件地址。
- Google Cloud 控制台账号电子邮件地址:此电子邮件地址对应的账号对您的 OAuth 2.0 应用所用的 Google Cloud 控制台账号具有管理员访问权限。
- Google Ads 经理账号电子邮件地址:这些电子邮件地址在您通过 Google Ads API 访问的经理 Google Ads 账号中拥有管理员权限。为应用生成刷新令牌时,您通常会使用以下电子邮件地址之一对 Google Ads API 应用进行身份验证。
我们强烈建议您使用共享团队别名,这样即使个别团队成员更换团队或离开公司,您也不会失去对这些账号的访问权限。
本指南的其余部分将详细介绍上述每封电子邮件,以及如何更新这些电子邮件,以使用共享团队别名而不是个人用户的电子邮件地址。
Google Ads API 联系电子邮件地址是指您在注册 Google Ads API 时提供的电子邮件地址。您应确保可以访问此别名,并定期监控发送到此地址的电子邮件。在 API 审核、审核请求或需要立即处理的生产紧急情况期间,Google 会使用此电子邮件地址与您的团队联系。使用共享的团队别名作为联系电子邮件地址,以确保整个团队都能收到这些通知。
请按照以下步骤更新 API 联系人电子邮件地址:
登录您的 Google Ads 经理账号。
点击屏幕左下角的管理。
在经理账号设置下,点击 API 中心。
在开发者详细信息下,记下 API 联系电子邮件地址。点击向下箭头,然后修改电子邮件。点击保存。
Google Cloud 控制台账号
Google API 控制台项目包含应用的 OAuth 凭据,并控制对 Google Ads API 的访问权限。通过将共享别名设为账号所有者,确保对该账号的访问权限。
请按照以下步骤更新 Google API 控制台项目的所有者:
- 登录 Google API 控制台。
- 从页面左上角的下拉菜单中选择您的项目。
- 在左侧菜单中,依次前往 IAM 和管理 > IAM。
- 点击授予访问权限按钮。
- 在添加主账号部分下输入共享电子邮件地址。
- 分配 Owner 角色。
- 点击保存按钮。如需详细了解如何授予和撤消访问权限,请参阅 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 调用的刷新令牌。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\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."]]