googleads python sdk “type” error - IpBlock

28 views
Skip to first unread message

Taylor

unread,
May 21, 2018, 5:32:14 PM5/21/18
to AdWords API and Google Ads API Forum

I am trying to modify the sample here: https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201802/targeting/add_customer_negative_criteria.py

to include the following (actual IP address redacted):

  {
      'xsi_type': 'IpBlock',
      'ipAddress': 'xx.xx.xxx.xx'
  }

instead of:

  {
      'xsi_type': 'ContentLabel',
      'contentLabelType': 'TRAGEDY'
  }

however when attempting to use "IpBlock" based on the documentation here: https://developers.google.com/adwords/api/docs/reference/v201802/CampaignCriterionService.IpBlock

I get the following error:

LookupError: No type 'IpBlock' in namespace http://www.w3.org/2001/XMLSchema. Available types are: .....

What am I doing wrong? My version is entirely unchanged from the sample except for changing the bracketed content as shown above.

Thanks!

Peter Oliquino (AdWords API Team)

unread,
May 22, 2018, 2:38:53 AM5/22/18
to AdWords API and Google Ads API Forum
Hi Taylor,

I could see that you are trying to create a CustomerNegativeCriterion in your request. However, the IpBlock criterion is currently not supported to be created as a CustomerNegativeCriterion. However, as an alternative, you can create it as a NegativeCampaignCriterion instead using the CampaignCriterionService.

Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team

Taylor

unread,
May 22, 2018, 5:26:17 PM5/22/18
to AdWords API and Google Ads API Forum
Thanks Peter. The clarification, while unfortunate, is most helpful.
Reply all
Reply to author
Forward
0 new messages