Python - Campaign Report - advertisingChannelType question

67 views
Skip to first unread message

Kevin Weitzner

unread,
Apr 26, 2016, 11:52:11 AM4/26/16
to AdWords API Forum
I've been trying a few different ways to setup the report definition such that I only get SEARCH campaigns.

report = {
      'reportName': 'Last 7 days CRITERIA_PERFORMANCE_REPORT',
      'dateRangeType': 'CUSTOM_DATE',

      'reportType': 'CRITERIA_PERFORMANCE_REPORT',
      'downloadFormat': 'CSV',
      'selector': {
          'fields': ['CampaignName','Status','Clicks','Impressions','Ctr','AverageCpc','AveragePosition','ConvertedClicks','ConversionValue','Cost','CampaignId'],
          'dateRange':{'min':'20160301','max':'20160425'},
          'advertisingChannelType':'SEARCH'
      }
  }

From what I've been able to find, the criterion should be called advertisingChannelType - however the python error is as such:
suds.TypeNotFound: Type not found: 'advertisingChannelType'


Shwetha Vastrad (AdWords API Team)

unread,
Apr 26, 2016, 1:39:14 PM4/26/16
to AdWords API Forum
Hi Kevin,

To filter results associated with SEARCH campaigns, you would need to add a predicate to the selector in the report definition. The predicate should contain the field, operator and the value to filter on. 

For example, in Python, the selector for the report should look something like this:

selector = {
         'fields':[...],
         'dateRange':{'min':[startDate], 'max':[endDate]},
         'predicates': [
              {
                    'field': 'AdNetworkType1',
                    'operator': 'EQUALS',
                    'values': 'SEARCH'
              }
         ]
}

Also, Criteria Performance Report does not contain the field AdvertisingChannelType. You can use AdNetworkType1 and AdNetworkType2 instead. 

Regards,
Shwetha, AdWords API Team.

Kevin Weitzner

unread,
Apr 27, 2016, 10:46:32 AM4/27/16
to AdWords API Forum
Thank you Shwetha - this solved it perfectly, now I understand the predicate functionality on the entire reporting system.
Reply all
Reply to author
Forward
0 new messages