Hi Akash, The AdGroupCriterionError.CANT_UPDATE_NEGATIVE <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.AdGroupCriterionError#reason> error you encountered means that you cannot update the negative criteria. You could only add or exclude the gender criteria in the Ad Group with Display Network only <https://support.google.com/google-ads/answer/2404190?visit_id=1-636688765430609387-4124838820&rd=1> campaign type <https://developers.google.com/adwords/api/docs/guides/campaigns-overview#campaign_types>. You may check this guide <https://developers.google.com/adwords/api/docs/appendix/criteria-usage> for more information on criteria usage. However, to further investigate your issue, could you provide the complete SOAP request and response logs when you encountered the AdGroupCriterionError.CANT_UPDATE_NEGATIVE and AdGroupCriterionError.CANNOT_TARGET_AND_EXCLUDE errors? Please reply via *Reply privately to author*.
Thanks and regards, Luis AdWords API Team On Friday, August 3, 2018 at 1:11:29 PM UTC+8, akash magar wrote: > > hi > I am new to adwords api and i want to know how to update demographics > criteria like gender and range as a examples given in samples section I > write below code but I don't know what exactly happens > > here is my code sample > > $genderTarget = new Gender(); > $genderTarget -> setId( 11 ); > > $genderBiddableAdGroupCriterion = new > BiddableAdGroupCriterion(); > $genderBiddableAdGroupCriterion -> setAdGroupId( > $adGroupId ); > $genderBiddableAdGroupCriterion -> setCriterion( > $genderTarget ); > > $genderBiddableAdGroupCriterionOperation = new > AdGroupCriterionOperation(); > $genderBiddableAdGroupCriterionOperation -> > setOperand( $genderBiddableAdGroupCriterion ); > $genderBiddableAdGroupCriterionOperation -> > setOperator( Operator::SET ); > $operations[] = > $genderBiddableAdGroupCriterionOperation; > > > $result = $adGroupCriterionService -> mutate( $operations > ); > > it gives me error like > AdGroupCriterionError.CANT_UPDATE_NEGATIVE @ operations[0].operand > > and when I set Operator to ADD it gives me error as > AdGroupCriterionError.CANNOT_TARGET_AND_EXCLUDE @ operations[0].operand > > so can anyone tell me what exactly wrong i am doing. > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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/55ca36e5-4c74-46d8-aab1-6d85e3a74e4d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.