Receiving an error when trying to create a radius around a LocationExtensionOperand

57 views
Skip to first unread message

Nick Petzold

unread,
May 7, 2019, 12:14:39 PM5/7/19
to AdWords API and Google Ads API Forum
Hi,

I am receiving the below error when trying to create a radius around the given location extension:

googleads.errors.GoogleAdsServerFault: [CriterionError.LOCATION_FILTER_INVALID @ operations[0].operand.criterion.matchingFunction; trigger:'70763381629']

This is as a result of the following code:

mutation_result = service.mutate(
   
[
       
{
           
"operator": "ADD",
           
"operand": {
               
"campaignId": third_party_model.third_party_id,
               
"criterion": {
                   
'xsi_type': 'LocationGroups',
                   
'feedId': feed_id,
                   
'matchingFunction': {
                       
'operator': 'IDENTITY',
                       
'lhsOperand': [
                           
{
                               
'xsi_type': 'LocationExtensionOperand',
                               
'radius': {
                                   
'xsi_type': 'ConstantOperand',
                                   
'type': 'DOUBLE',
                                   
'unit': unit,
                                   
'doubleValue': radius
                               
},
                               
'locationId': third_party_relation.third_party_id
                           
},
                       
],
                   
}
               
},
           
},
       
}
   
]
)


Any help as to what is going wrong here would be much appreciated. Am I accessing the correct LocationExtension ID?

Many thanks,
Nick

Full stack trace:

Traceback (most recent call last):
 
File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1382, in MakeSoapRequest
   
*packed_args, _soapheaders=soap_headers)['body']['rval']
 
File "/usr/local/lib/python3.6/site-packages/zeep/proxy.py", line 42, in __call__
   
self._op_name, args, kwargs)
 
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 132, in send
   
return self.process_reply(client, operation_obj, response)
 
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 194, in process_reply
   
return self.process_error(doc, operation)
 
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 299, in process_error
    detail
=fault_node.find('detail'))
zeep
.exceptions.Fault: [CriterionError.LOCATION_FILTER_INVALID @ operations[0].operand.criterion.matchingFunction; trigger:'70763381629']


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
 
File "/code/api/ad_networks/shared/sync.py", line 377, in sync_model
    third_party_advertiser_manager
,
 
File "/usr/local/lib/python3.6/functools.py", line 807, in wrapper
   
return dispatch(args[0].__class__)(*args, **kw)
 
File "/code/api/ad_networks/adwords/mutations/campaign/campaign.py", line 1086, in update_model_campaign
    third_party_advertiser_manager
,
 
File "/code/api/ad_networks/adwords/mutations/campaign/campaign.py", line 2215, in sync_campaign_location_extension_radius_targeting
    loc_ext_radius_targeting
=loc_ext_targeting,
 
File "/code/api/ad_networks/adwords/mutations/campaign/campaign.py", line 2299, in add_location_extension_radius_targeting_to_campaign
   
'locationId': third_party_relation.third_party_id
 
File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1394, in MakeSoapRequest
    e
.detail, errors=error_list, message=e.message)
googleads
.errors.GoogleAdsServerFault: [CriterionError.LOCATION_FILTER_INVALID @ operations[0].operand.criterion.matchingFunction; trigger:'70763381629']

googleadsapi...@google.com

unread,
May 7, 2019, 3:16:05 PM5/7/19
to nickp...@gmail.com, AdWords API and Google Ads API Forum
Hello Nick, 

Thank you for the details. It looks like you're giving the campaign Id to the Location Id. The Location criteria should be selected from the GeoTargets available here. The code sample available here should be helpful to add locations to the LocationGroups. Could you please give this a try and let us know if you have any issues?

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Nick Petzold

unread,
May 8, 2019, 6:46:33 AM5/8/19
to AdWords API and Google Ads API Forum
Hi Bharani,

We were under the impression that we were able to provide the id to the location in the specified feed that we wanted to target in real time. I don't think using the csv file would be feasible as this would only update once a month.

I suppose we could use the location information in the feed to create a location criterion, but I'm not sure how risky that would be in terms of the platform's ability to accurately place the location though...

Thanks for your help anyway,
Nick
Reply all
Reply to author
Forward
0 new messages