Hello!
I'm using Google Adwords API via Java library 'com.google.api-ads:ads-lib:1.37.0' and 'com.google.api-ads:adwords-axis:1.3.7'.
Adding new ProductScope for ShoppingCampaign works fine, but I have problem with reading existing ProductScope and modifying it.
1) So, there is shopping campaign. I created product scope via google adwords web interface with one dimension (ProductBrand).
2) I try to read this scope with Java library:
CampaignCriterionServiceInterface campaignCriterionService = new AdWordsServices().get(adWordsSession, CampaignCriterionServiceInterface.class);
CampaignCriterionPage campaignCriterionPage = campaignCriterionService.get(selector);
//Output number of entries
System.out.println(">>>" + campaignCriterionPage.getTotalNumEntries());
ProductScope ps = null;
for (CampaignCriterion cc: campaignCriterionPage.getEntries()) {
//Searching for ProductScope
if (cc.getCriterion().getCriterionType().equals("ProductScope")) {
System.out.println(cc.getCriterion().getType().getValue());
//Cast Criterion
ps = (ProductScope)cc.getCriterion();
//Get dimensions
System.out.println(ps.getDimensions());
}
}
The output is:
getDimensions returns NULL, but i know, that it realy containts one dimension at least. :(