Google AdWords API v201802:字段选择器不适用于 python 库

Google AdWords API v201802: fields selector not working with python libraries

我正在通过 API v201802 和最新的 Python3 googleads 模块连接到 Google AdWords。连接工作正常,我可以检索广告系列或广告组的数据,但字段选择器似乎不起作用。我只想请求几个字段,但我收到了所有可用字段。我是不是忽略了什么?

from googleads import adwords

adwords_client = adwords.AdWordsClient.LoadFromStorage()
ad_group_service = adwords_client.GetService('AdGroupService', version='v201802')
selector = {
    'fields': ['Id', 'Name', 'Status', 'CampaignId'],
    'paging': {
        'startIndex': '0',
        'numberResults': '500'
    }
}
page = ad_group_service.get(selector)
print(page)

结果:

{
    'totalNumEntries': 138,
    'Page.Type': 'AdGroupPage',
    'entries': [
        {
            'id': 44831117552,
            'campaignId': 888843682,
            'campaignName': None,
            'name': '001_0001_BMM_xxx',
            'status': 'ENABLED',
            'settings': [],
            'labels': [],
            'forwardCompatibilityMap': [],
            'biddingStrategyConfiguration': None,
            'contentBidCriterionTypeGroup': None,
            'baseCampaignId': None,
            'baseAdGroupId': None,
            'trackingUrlTemplate': None,
            'finalUrlSuffix': None,
            'urlCustomParameters': None,
            'adGroupType': None,
            'adGroupAdRotationMode': None
        },
        ...
    ] }

当然我可以在处理响应时过滤掉不需要的字段,但我想知道为什么字段选择器不起作用...

我刚刚在 adwords-api google groups 中找到了答案:

Hi Kevin,

The API will always include the fields your are requesting in the response, but it might also add other fields that will be grouped together to some of your original fields.

Best,

David Torres - AdWords API Team