I am creating a campaign using the Adwords API, and then trying to
configure it so that users with UNDETERMINED ages don't see the ads. I get
an error when I try to do this.
Here is the code I am using:
CampaignCriterionServiceInterface criterionService =
services.get(session, CampaignCriterionServiceInterface.class);
AgeRange ageRange = new AgeRange();
ageRange.setAgeRangeType(AgeRangeAgeRangeType.AGE_RANGE_UNDETERMINED);
NegativeCampaignCriterion criterion = new NegativeCampaignCriterion();
criterion.setCriterion(ageRange);
criterion.setCampaignId(campaignId);
CampaignCriterionOperation operation = new CampaignCriterionOperation();
operation.setOperand(criterion);
operation.setOperator(Operator.ADD);
CampaignCriterionOperation[] operations = new
CampaignCriterionOperation[] {operation};
criterionService.mutate(operations);
Here is the error:
[RequiredError.REQUIRED @ operations[0].operand.criterion.id]
It seems that the id on the criterion is required, but I don't have an id
since I'm trying to create this criterion. Is this supported through the
API?
Thanks,
Michael
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.