Problem trying to create a Proximity around a Location Extension using the AdWords API

73 views
Skip to first unread message

Nick Petzold

unread,
Apr 30, 2019, 5:17:37 PM4/30/19
to AdWords API and Google Ads API Forum
Hi guys,

I'm having some issues with the below mutation call:

mutation_result = service.mutate(
   
[
       
{
           
"operator": "ADD",
           
"operand": {
               
"campaignId": campaign_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': location_id
                           
},
                       
],
                   
}
               
},
           
},
       
}
   
]
)

I get two different errors depending on how it is called. To give some context, the above call is made as part of a wider operation to first create the location extension, and then create the proximity radius around it. If I just run it as is, it raises the below Unmarshalling Error:

googleads.errors.GoogleAdsServerFault: Unmarshalling Error: For input string: "12195786098815662524"

However, if I put in a codebreak with pdb(), I get the following error once the code is restarted:

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

I am assuming the difference in error is because there is some delay incorporated in the second run, but I have no idea why. Can anyone explain what I am doing wrong here?

To clarify, the strings in each error above refer to location IDs, the only reason they are seen to be different is because the locations have been generated as part of the wider code. They should be exactly the same in there structure/makeup.

Thanks in advance!

googleadsapi...@google.com

unread,
May 1, 2019, 3:05:59 PM5/1/19
to AdWords API and Google Ads API Forum
Hello Nick, 

Could you please share the request and response where you're receiving the error? You can share the details privately via Reply privately to author option.

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/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages