Google Ads API - Unbound variable for CampaignCriterion

282 views
Skip to first unread message

Pode Marut

unread,
Aug 4, 2021, 12:38:34 PM8/4/21
to AdWords API and Google Ads API Forum
Hi Team, Developers

I'm using Google Ads API and please find the following versions below:

build.gradle
implementation 'com.google.api-ads:google-ads:14.0.0'
implementation group: 'com.google.api', name: 'gax', version: '1.65.1'
implementation group: 'com.google.api', name: 'gax-grpc', version: '1.65.1'

The problem is when calling:
ResourceNames.campaignCriterion(123, 456, 789);
It always return with the exception below:
Exception in thread "main" com.google.api.pathtemplate.ValidationException: Unbound variable 'campaign_id}~{criterion_id'. Bindings: {customer_id=123, campaign_id=456, criterion_id=789}
at com.google.api.pathtemplate.PathTemplate.instantiate(PathTemplate.java:734)
at com.google.api.pathtemplate.PathTemplate.instantiate(PathTemplate.java:681)
at com.google.api.pathtemplate.PathTemplate.instantiate(PathTemplate.java:692)
at com.google.ads.googleads.v8.resources.CampaignCriterionName.toString(CampaignCriterionName.java:153)
at com.google.ads.googleads.v8.resources.CampaignCriterionName.format(CampaignCriterionName.java:87)
at com.google.ads.googleads.v8.utils.ResourceNames.campaignCriterion(ResourceNames.java:415)
at com.dentsu.setup_campaign.service.adwords.impl.GoogleAdsService.main(GoogleAdsService.java:218)

Even it's the mock ids but the method ResourceNames.campaignCriterion() should return the string back without "Unbound variable" error.
I'm not to sure that I use the correct one.

Thanks,
Marut

Google Ads API Forum Advisor

unread,
Aug 5, 2021, 4:53:37 PM8/5/21
to pode...@gmail.com, adwor...@googlegroups.com
Hi Marut,

I suggest you bring this to the Ads API Java Client Library issue tracker.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


 

ref:_00D1U1174p._5004Q2HLnm4:ref
Reply all
Reply to author
Forward
0 new messages