Hi everyone,

I'm trying add a group of criteria to my campaign, like bellow, but I'm 
getting an error message saying CANNOT_ADD_CRITERIA_TYPE.

You could find request and response logs attached.

using (CampaignCriterionService campaignCriterionService = 
> (CampaignCriterionService)user.GetService(AdWordsService.v201809.CampaignCriterionService))
>             {
>                 Location california = new Location()
>                 {
>                     id = 21137L
>                 };
>                 Location mexico = new Location()
>                 {
>                     id = 2484L
>                 };
>                 Gender Male = new Gender()
>                 {
>                     genderType = GenderGenderType.GENDER_MALE
>                 };
>                 List<Criterion> criteria = new List<Criterion>()
>                 {
>                     california,
>                     mexico,
>                     Male
>                 };
>                 List<CampaignCriterionOperation> operations = new 
> List<CampaignCriterionOperation>();
>                 foreach (Criterion criterion in criteria)
>                 {
>                     CampaignCriterionOperation operation = new 
> CampaignCriterionOperation()
>                     {
>                         operand = new CampaignCriterion()
>                         {
>                             campaignId = 1723312294,
>                             criterion = criterion
>                         },
>                         @operator = Operator.ADD
>                     };
>                     operations.Add(operation);
>                 }
>                 try
>                 {
>                     CampaignCriterionReturnValue retVal = 
> campaignCriterionService.mutate(operations.ToArray());
>                 }
>                 catch (Exception e)
>                 {
>                     throw;
>                 }
>             } 


Many Thanks,
Zied Chaari
 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
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/5d0303b7-5fcf-4ffe-858b-d3e5e0cb0b2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: request.xml
Description: XML document

Attachment: response.xml
Description: XML document

  • Campaig... Zied Chaari
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to