我无法收到 Google Adwords Customers Campagin 通知
I can't get Google Adwords Customers Campagin inform
我想构建一个网络应用程序。客户可以使用网络应用程序读取他们的 google Adwrods 帐户信息(活动或预算)。
首先,我使用 oath2 获取客户的 refresh_token 和 access_token。
使用 refresh_token,我可以通过 (https://github.com/googleads/google-ads-ruby)
获取客户端下的所有 adwords id
client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
config.client_id = "client_id"
config.client_secret = "client_secret"
config.refresh_token = "refresh_token"
config.login_customer_id = "XXX-XXX-XXXX"
config.developer_token = "XXXXXXXXXXXXXXXX"
end
accessible_customers = client.service.customer.list_accessible_customers().resource_names
当我想获取客户的Adword账户信息时,
resource_name = client.path.customer("XXXXXXXX")
customer = client.service.customer.get_customer(resource_name: resource_name)
我收到“GRPC::未验证:16:Request 缺少必需的身份验证凭据。需要 OAuth 2 访问令牌、登录 cookie 或其他有效的身份验证凭据”,但配置文件无法让我设置 access_token.
那么,我可以在哪里设置客户端的access_token,或者我错过了哪一步?
错误提示您 client
设置不正确。这可能是从 Google 帐户到错误信息的一系列问题。我会检查并确保您传递的所有信息 Google::Ads::GoogleAds::GoogleAdsClient.new
都是正确的。
此外,您只需要为经理帐户传递 'login_customer_id',这听起来不像您是经理帐户。
来自https://github.com/googleads/google-ads-ruby/blob/master/google_ads_config.rb
# Required for manager accounts only: Specify the login customer ID used to
# authenticate API calls. This will be the customer ID of the authenticated
# manager account. If you need to use different values for this field, then
# make sure fetch a new copy of the service after each time you change the
# value.
# c.login_customer_id = 'INSERT_LOGIN_CUSTOMER_ID_HERE'
我想构建一个网络应用程序。客户可以使用网络应用程序读取他们的 google Adwrods 帐户信息(活动或预算)。
首先,我使用 oath2 获取客户的 refresh_token 和 access_token。 使用 refresh_token,我可以通过 (https://github.com/googleads/google-ads-ruby)
获取客户端下的所有 adwords idclient = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|
config.client_id = "client_id"
config.client_secret = "client_secret"
config.refresh_token = "refresh_token"
config.login_customer_id = "XXX-XXX-XXXX"
config.developer_token = "XXXXXXXXXXXXXXXX"
end
accessible_customers = client.service.customer.list_accessible_customers().resource_names
当我想获取客户的Adword账户信息时,
resource_name = client.path.customer("XXXXXXXX")
customer = client.service.customer.get_customer(resource_name: resource_name)
我收到“GRPC::未验证:16:Request 缺少必需的身份验证凭据。需要 OAuth 2 访问令牌、登录 cookie 或其他有效的身份验证凭据”,但配置文件无法让我设置 access_token.
那么,我可以在哪里设置客户端的access_token,或者我错过了哪一步?
错误提示您 client
设置不正确。这可能是从 Google 帐户到错误信息的一系列问题。我会检查并确保您传递的所有信息 Google::Ads::GoogleAds::GoogleAdsClient.new
都是正确的。
此外,您只需要为经理帐户传递 'login_customer_id',这听起来不像您是经理帐户。
来自https://github.com/googleads/google-ads-ruby/blob/master/google_ads_config.rb
# Required for manager accounts only: Specify the login customer ID used to
# authenticate API calls. This will be the customer ID of the authenticated
# manager account. If you need to use different values for this field, then
# make sure fetch a new copy of the service after each time you change the
# value.
# c.login_customer_id = 'INSERT_LOGIN_CUSTOMER_ID_HERE'