Possible api bug retrieving keywords with a selector

26 views
Skip to first unread message

Emmanuel Espina

unread,
Aug 28, 2014, 12:22:40 PM8/28/14
to adwor...@googlegroups.com
I'm experiencing something quite strange with the AdgroupCriterion service. If I try to retrieve all the keywords from an adgroup and I include the MatchType in the selector fields I get all the keywords triplicated with the same match type. If I remove that field from the selector the result is ok (however I receive the match type anyway although I didn't ask for it!).
Is this a bug in the api?

This is the code I used for testing. In bold is the only thing I removed to change the response from:

    Selector selector = new Selector();
    selector.setFields(new String[]{"Id", "AdGroupId",  "MatchType", "KeywordText", "Status"});
    selector.setPredicates(new Predicate[]{
        new Predicate("AdGroupId", PredicateOperator.EQUALS, new String[]{"11563952819"}),
        new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[]{"KEYWORD"})
        });
    
    AdWordsServices adWordsServices = new AdWordsServices();
    AdGroupCriterionServiceInterface adGroupCriterionService =
        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);
    
    AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
        BiddableAdGroupCriterion biddableAdGroupCriterion = (BiddableAdGroupCriterion)  adGroupCriterionResult;
        Keyword keyword = (Keyword) biddableAdGroupCriterion.getCriterion();
        
        System.out.println(keyword.getText() + " " + keyword.getMatchType());
        }

First result (wrong)
Entre Marte Y La Luna Merlo EXACT
Entre Marte Y La Luna Merlo EXACT
Entre Marte Y La Luna Merlo EXACT
Entre Marte Y La Luna EXACT
Entre Marte Y La Luna EXACT
Entre Marte Y La Luna EXACT

Second result (quite ok, but with the match type y didn't asked)
Entre Marte Y La Luna Merlo EXACT
Entre Marte Y La Luna EXACT

Josh Radcliff (AdWords API Team)

unread,
Aug 28, 2014, 1:02:02 PM8/28/14
to adwor...@googlegroups.com
Hi,

We're aware of this issue and are looking into it, but in the meantime you can ignore the duplicates. Note that an AdGroupCriterion is uniquely identified by the combination of AdGroup ID and Criterion ID.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages