【问题标题】:How to get client customer id after authentication to adwords如何在对 adwords 进行身份验证后获取客户客户 ID
【发布时间】:2017-04-21 16:42:23
【问题描述】:

我在我的应用程序中使用 python 客户端库。用户通过他的 adwords 帐户进行身份验证并批准权限。我会检索经过身份验证的用户的客户端客户 ID。当用户通过身份验证时,我会获得与用户相关的凭据,并且我希望将 client_customer_id 绑定到该凭据。

【问题讨论】:

  • 您的问题不清楚。我不知道为什么人们赞成它。澄清一下,您是在问如何获取单个帐户或 MCC 帐户的客户客户 ID?您是在询问您验证的帐户的客户客户 ID 吗?或者,您是在询问您通过身份验证的帐户中的某个帐户的客户客户 ID?

标签: python google-oauth google-ads-api


【解决方案1】:

您使用的 adwords api 版本如何?

我使用的是 v201607 版本。

您可以使用 get_account_hierarchy 获取当前帐户下的帐户层次结构。

https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201607/account_management/get_account_hierarchy.py

【讨论】:

  • 我正在使用 v201702,问题是获取当前连接用户的客户端客户 ID,我找到了方法:我使用了客户服务:oauth2_client = oauth2.GoogleRefreshTokenClient(client_id, client_secret, refresh_token) # 初始化 AdWords 客户端。 adwords_client = adwords.AdWordsClient( developer_token, oauth2_client, user_agent) customers = adwords_client.GetService('CustomerService').getCustomers() customer= customer[0] customer_id = customer2['customerId']
猜你喜欢
  • 2017-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-10
相关资源
最近更新 更多