Setting location in AdGroupCriterion error

79 views
Skip to first unread message

celerary

unread,
Dec 1, 2023, 5:32:10 AM12/1/23
to Google Ads API and AdWords API Forum
Hi,
code example:
----------------------------------------------------------------------
ad_group_criterion_service = client.get_service("AdGroupCriterionService")
operations = []
ad_group_criterion_operations = client.get_type("AdGroupCriterionOperation")

geo_target_constant_service = client.get_service("GeoTargetConstantService")
location_type = client.get_type("CriterionTypeEnum").CriterionType.LOCATION
country_list = ['US']
country_id = {"US": 2840}
for country in country_list:
    loc_op = deepcopy(ad_group_criterion_operations)
    location_adgroup_criterion_loc = loc_op.create
    location_adgroup_criterion_loc.type_ = location_type
    location_adgroup_criterion_loc.location.geo_target_constant = (
    geo_target_constant_service.geo_target_constant_path(country_id[country])
        )
    location_adgroup_criterion_loc.ad_group = "xxxx"
operations.append(loc_op)
ad_group_criterion_response = ad_group_criterion_service.mutate_ad_group_criteria(
        customer_id='xx',
        operations=operations,
    )
----------------------------------------------
error:
Request made: ClientCustomerId: 3534893523, Host: googleads.googleapis.com, Method: /google.ads.googleads.v15.services.AdGroupCriterionService/MutateAdGroupCriteria, RequestId: b-9FSoB33g6CUqbrbZaT3g, IsFault: True, FaultMessage: The error code is not in this version.

Could you help to check this error?
Thanks!

Google Ads API Forum Advisor

unread,
Dec 1, 2023, 2:55:25 PM12/1/23
to lron...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

By reviewing your concern, I understand that you are getting an error while using AdGroupCriterionService via Google Ads API. To assist you better, we would require the complete API logs (request and response with request-id and request header) to investigate this issue further on our end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qW3DI:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages