用户身份验证的Google Adwords API问题

时间:2011-06-14 15:26:16

标签: ruby google-adwords

我正在向特定帐户添加广告系列,因此我拥有一系列帐户,然后我从数据库中获取这些广告系列并向这些帐户添加广告系列。

我连接到生产环境,获得响应

CONNECTION ESTABLISHED

但是当我尝试添加广告系列后,我收到了错误

AuthenticationError.NOT_ADS_USER @ ; trigger:'652428713780' Service[CampaignService.mutate]

调用此代码的部分代码:

 @srv[:campaign]= @adwords.get_service('Campaign',AdWords::Service.latest_version)
 def add_campaign(name, cc = 'HU', status = nil, budget = nil)
  budget ||= AdWordsConfig.get('hu_campaign_budget').value.to_f
  status ||= @srv[:campaign].module::CampaignStatus::PAUSED

  operation = {
    :operand => {
    :name                        => "API - #{name}",
    :status                      => status,
      :biddingStrategy             => @srv[:campaign].module::ManualCPC.new,
      :budget => {
      :period                    => 'DAILY',
      :amount => {
      :microAmount             => (budget * AMOUNT_MULTIPLIER)
    },
      :deliveryMethod            => 'ACCELERATED'
    }
  },
    :operator                      => 'ADD'
  }

  response = @srv[:campaign].mutate([operation])
  response.rval.value.first
  cid = response.rval.value.first.id

  response.rval.value.first
end

我在google API文档中发现此错误意味着

#   NOT_ADS_USER

  User in the cookie is not a valid Ads user.

但我甚至不知道如何检查cookie。 我正在运行rake任务,是否可以在连接到adwords google com后检索cookie?

1 个答案:

答案 0 :(得分:0)

您可以按照此处的讨论进行操作:https://groups.google.com/d/topic/adwords-api/BT8mM1vaSVE/discussion