Hello Jelly,
Correct. Exclusions are on the Campaign level while targeting is per AdGroup. -Danial, AdWords API Team. On Tuesday, October 14, 2014 6:01:56 AM UTC+4, Jelly Hu wrote: > > Hi, > > Sorry,I find that I need to use AdGroupCriterionService() instead of > CampaignCriterionService() to target APP.It works OK. > > Thank you. > > On Monday, October 13, 2014 7:56:52 PM UTC+8, Jelly Hu wrote: >> >> >> Hi, >> >> I use the CampaignCriterionService to add the criterion which targets an >> application .For example,to target the Clash of Clons (1-529479190). >> >> below is the main code: >> $campaignId = 'MY_CAMPAIGN_ID'; >> $campaigncriterionservice= >> $user->GetService('CampaignCriterionService', ADWORDS_VERSION); >> $operations = array(); >> >> //Create campaigncriterion. >> $campaigncriterion = new CampaignCriterion(); >> $campaigncriterion->campaignId = $campaignId; >> >> //target the app. >> $criterion = new MobileApplication(); >> $criterion->appId = '1-529479190'; >> >> $campaigncriterion->criterion = $criterion; >> $campaigncriterionoperation = new CampaignCriterionOperation(); >> $campaigncriterionoperation->operand = $campaigncriterion; >> $campaigncriterionoperation->operator = 'ADD'; >> $operations[] = $campaigncriterionoperation; >> >> $result = $campaigncriterionservice->mutate($operations); >> >> It returns the error :An error has occurred: >> [CriterionError.CANNOT_ADD_CRITERIA_TYPE @ operations[0].operand.criterion] >> >> But when I change the type CampaignCriterion() into >> NegativeCampaignCriterion() >> ,It blocks the App and works OK. >> Please help me. >> >> Thanks. >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords 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 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 http://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/7b60b5d5-a9b8-4fda-9e3c-c0ee353a6234%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.