getDimensions for ProductScope returns NULL :(

49 views
Skip to first unread message

Михаил Бесчетнов

unread,
Mar 4, 2015, 8:43:10 AM3/4/15
to adwor...@googlegroups.com
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:

>>>4
PRODUCT_SCOPE
NULL

getDimensions returns NULL, but i know, that it realy containts one dimension at least. :(

Josh Radcliff (AdWords API Team)

unread,
Mar 4, 2015, 9:05:50 AM3/4/15
to adwor...@googlegroups.com
Hi,

Which fields are you including in your Selector? Specifically, are you including "Dimensions" as specified here?

If that doesn't resolve the issue, please provide your campaign ID so I can investigate further.

Thanks,
Josh, AdWords API Team

Михаил Бесчетнов

unread,
Mar 4, 2015, 10:03:30 AM3/4/15
to adwor...@googlegroups.com
Thank you!

Reading documentation realy solved a issue.
And some other issues...
Reply all
Reply to author
Forward
0 new messages