Hi, The SelectorError.INVALID_FIELD_NAME <https://developers.google.com/adwords/api/docs/common-errors#SelectorError.INVALID_FIELD_NAME> error occurs because GenderType field is a field of Gender <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignCriterionService.Gender> criterion and this type of criterion can only be used for AdGroupCriterionService <https://developers.google.com/adwords/api/docs/reference/v201809/AdGroupCriterionService> , CampaignCriterionService <https://developers.google.com/adwords/api/docs/reference/v201809/CampaignCriterionService>, and ConstantDataService <https://developers.google.com/adwords/api/docs/reference/v201809/ConstantDataService>. The LocationCriterionService <https://developers.google.com/adwords/api/docs/reference/v201809/LocationCriterionService> can only contain selectors under LocationCriterion <https://developers.google.com/adwords/api/docs/reference/v201809/LocationCriterionService.LocationCriterion> and Location <https://developers.google.com/adwords/api/docs/reference/v201809/LocationCriterionService.Location> .
Best regards, Peter AdWords API Team On Wednesday, November 21, 2018 at 2:11:14 PM UTC+8, tahirhanyildizog...@gmail.com wrote: > > > Hi, i am trying to add different types of criterions to selector and get > the reach number according to that criterions. In below code i tried to add > gender type criterion to selector but i get error. > > Code > > > def get_reach(client, country_list, gender_list): > # Initialize appropriate service. > location_criterion_service = client.GetService( > 'LocationCriterionService', version='v201809') > > # Create the selector. > selector = { > 'fields': ['Id', 'LocationName', 'DisplayType', 'GenderType', > 'CanonicalName', 'Reach', 'TargetingStatus'], > 'predicates': [{ > 'field': 'LocationName', > 'operator': 'EQUALS', > 'values': country_list > },{ > 'field': 'GenderType', > 'operator': 'EQUALS', > 'values': gender_list > }] > } > > # Make the get request. > location_criteria = location_criterion_service.get(selector) > > > > Output > > googleads.errors.GoogleAdsServerFault: [SelectorError.INVALID_FIELD_NAME @ > selector; trigger:'GenderType', SelectorError.INVALID_PREDICATE_FIELD_NAME > @ selector; trigger:'GenderType'] > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/8527a8a2-f9f8-42c8-9c87-e771cdccf4a7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.