【问题标题】:google adwords python api - how to get ad group bidgoogle adwords python api - 如何获得广告组出价
【发布时间】:2014-03-24 09:40:12
【问题描述】:

我正在使用 adwords python api。我需要获取出价金额和类型。例如。出价=4 广告类型 = 每次点击费用。

我得到了广告组 ID。

以下是创建和广告组的示例。创建后...如何检索设置?我如何得到例如我设置的出价?

ad_group_service = client.GetService('AdGroupService', version='v201402')

operations = [{
      'operator': 'ADD',
      'operand': {
          'campaignId': campaign_id,
          'name': 'Earth to Mars Cruises #%s' % uuid.uuid4(),
          'status': 'ENABLED',
          'biddingStrategyConfiguration': {
              'bids': [
                  {
                      'xsi_type': 'CpcBid',
                      'bid': {
                          'microAmount': '1000000'
                      },
                  }
              ]
          }
      }
  }]
  ad_groups = ad_group_service.mutate(operations)

【问题讨论】:

    标签: python google-ads-api


    【解决方案1】:

    查看googlads的github页面上对应的example

    基本上,您将使用AdGroupServiceget 方法和包含正确字段和谓词的选择器来检索包含您感兴趣的AdGroup 对象的AdGroupPage

    selector = {
          'fields': ['Id', 'Name', 'CpcBid'],
          'predicates': [
              {
                  'field': 'Id',
                  'operator': 'EQUALS',
                  'values': [given_adgroup_id]
              }
          ]
    }
    
    page = adgroup_service.get(selector)
    
    adgroup = page.entries[0]
    
    print('Adgroup "%s" (%s) has CPC %s' % (adgroup.name, adgroup.id,
           adgroup.biddingStrategyConfiguration.bids.bid))
    

    可以在selector reference page 中找到可用字段的名称以及它们在返回的对象中填充的属性。 AdGroupServicereference page 可能也很有趣。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多