Block IPs on Google Ads API v2 Beta using Python Library
I'm trying to block an IP list through Google API v2 but I'm getting the error "Criteria type can not be targeted." on field: operations, on field: create, on field: ip_block. Another doubt that I have, is if I will need to repeat the create operation for each IP on my list or there is a way to put multiple Ip on the same request.
client = (google.ads.google_ads.client.GoogleAdsClient.load_from_storage(path="./google-ads.yaml")) campaign_criterion_operation = client.get_type('CampaignCriterionOperation', version='v2') campaign_criterion = campaign_criterion_operation.create campaign_criterion.campaign.value = campaign_service.campaign_path(customer, campaign) campaign_criterion.ip_block.ip_address.value = "xxx.xxx.xxx.xxx" campaign_criterion_response = campaign_criterion_service.mutate_campaign_criteria(customer, [campaign_criterion_operation]) for reponse in campaign_criterion_response.results: print('Added campaign criterion "%s".' % reponse.resource_name)