CampaignCriterionError.CONCRETE_TYPE_REQUIRED @ operations[0].operand.criterion - When trying to add geo location

233 views
Skip to first unread message

Yehoshaphat Schellekens

unread,
Apr 27, 2015, 4:47:54 PM4/27/15
to adwor...@googlegroups.com
Hi All 

I'm trying to add a geo location using the following code ,and getting the following error

CampaignCriterionError.CONCRETE_TYPE_REQUIRED @ operations[0].operand.criterion

i'm not really sure what i'm doing wrong:
 
    Criterion criterion = new Criterion();
       criterion
.setId(Long.parseLong("1012873")); // a dma of Anchorage, AK
       criterion
.setCriterionType("LOCATION");
       
       
CampaignCriterion Criterion = new CampaignCriterion();
       
Criterion.setCriterion(criterion);
       
Criterion.setCampaignId(Long.parseLong("246273610"));
       
       
CampaignCriterionOperation create = new CampaignCriterionOperation();
       create
.setOperand(Criterion);
       create
.setOperator(Operator.ADD);
       
       
CampaignCriterionOperation[] operations = new CampaignCriterionOperation[] {create};
       campaignCriterionService
.mutate(operations);

i know that i do have a campaign id of "1012873" since i extracted it:
using data that i store in a hashBasedtable , that extracts campaign ID from my existing account:

{246273610={30002=PLATFORM, 30000=PLATFORM, 30001=PLATFORM}, 242139610={1000=LANGUAGE, 1023191=LOCATION, 21137=LOCATION, 30002=PLATFORM, 2376=LOCATION, 30000=PLATFORM, 2840=LOCATION, 30001=PLATFORM}, 246273490={30002=PLATFORM, 30000=PLATFORM, 30001=PLATFORM}}





Josh Radcliff (AdWords API Team)

unread,
Apr 27, 2015, 5:38:40 PM4/27/15
to adwor...@googlegroups.com
Hi,

Please try creating a new Location object (via new Location()) instead of a new Criterion object in your first line and let me know if that does not resolve the issue for you.

Thanks,
Josh, AdWords API Team

Yehoshaphat Schellekens

unread,
Apr 28, 2015, 7:48:17 AM4/28/15
to adwor...@googlegroups.com
Thanks , that did the Job!
Reply all
Reply to author
Forward
0 new messages