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.