Re: Operations - preparing in the cycle

21 views
Skip to first unread message

Kevin Winter (AdWords API Team)

unread,
Mar 26, 2013, 10:45:07 AM3/26/13
to adwor...@googlegroups.com
Hi,
  The 502 error usually indicates a temporary server error.  You're always seeing a 502 when sending 23 ad groups?  (but not 22?)  Could you attach the full SOAP logs (with authtoken, devtoken, etc, removed)?

- Kevin Winter
AdWords API Team

On Wednesday, March 20, 2013 1:38:42 PM UTC-4, achil wrote:
Hello,

I have a question for inserting ad groups. Please advice. I do not know if I proceed correctly? I can not insert more ad groups. I need to insert more than 5000 ad groups. Ad groups has one keyword and two text ads.

Operations - preparing in the cycle. This way I can add a maximum of 22 ad groups. When I create the field manually, they can put more ad groups. But the number of ads is not constant, so it can not be about used.

When I want to create more than 22 ad groups, rubyscript of late error:

AdsCommon::Errors::HttpError
HTTP Error occurred: HTTP error (502):
The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.

I can not figure out what is wrong.

a/ in cycle

campaign_id = 000000000
ide = 21
idx = 0

# array_xml.each do |arr|
(0..21).each do |idx|
  ad_groups << {
    :name => "%d RS #%d" % [1 + idx, (Time.new.to_f * 1000).to_i],
    :status => 'ENABLED',
    :campaign_id => campaign_id,
    :bids => {
      :xsi_type => 'ManualCPCAdGroupBids',
      :keyword_max_cpc => {
        :amount => {
          :micro_amount => 10000000
        }
      },
      :keyword_content_max_cpc => {:amount => {:micro_amount => 2000000}}
    },
    :settings => [
      {
        :xsi_type => 'TargetingSetting',
        :details => [
          {
            :xsi_type => 'TargetingSettingDetail',
            :criterion_type_group => 'PLACEMENT',
            :target_all => true
          },
          {
            :xsi_type => 'TargetingSettingDetail',
            :criterion_type_group => 'VERTICAL',
            :target_all => false
          }
        ]
      }
    ]
  }
  idx += 1
  break if (idx > ide)
end

b/ manually prepared

ad_groups = [
  {
    :name => "1 RS #%d" % [(Time.new.to_f * 1000).to_i],
    :status => 'ENABLED',
    :campaign_id => campaign_id,
    ...
  },
  {
    :name => "2 RS #%d" % [(Time.new.to_f * 1000).to_i],
    :status => 'ENABLED',
    :campaign_id => campaign_id,
    ...
  },
  ...
  ...
  {
    :name => "XX RS #%d" % [(Time.new.to_f * 1000).to_i],
    :status => 'ENABLED',
    :campaign_id => campaign_id,
    ...
  }
]

ruby 1.9.3p0
client library Ruby v201209 / 7.2
rubyscripts from examples

Thank you for any advice and help

Reply all
Reply to author
Forward
0 new messages