GetKeywords printing each result 3 times

62 views
Skip to first unread message

Aditya

unread,
Apr 8, 2015, 1:57:00 PM4/8/15
to adwor...@googlegroups.com
I'm running the standard GetKeywords.java from the library. I put in the ID for a test ad group that I set up (with just a few keywords). This program prints out the expected results, but each one is printed out 3 times in a row. I can't see anything obvious in the code that would cause these to be printed out multiple times, so does anyone have an idea what might be happening?

Here's an example of what I see:

Keyword ad group criterion with ad group id "19839877629", criterion id "11744392", text "dynamics" and match type "BROAD" was found.

Keyword ad group criterion with ad group id "19839877629", criterion id "11744392", text "dynamics" and match type "BROAD" was found.

Keyword ad group criterion with ad group id "19839877629", criterion id "11744392", text "dynamics" and match type "BROAD" was found.

Keyword ad group criterion with ad group id "19839877629", criterion id "17359491", text "app" and match type "BROAD" was found.

Keyword ad group criterion with ad group id "19839877629", criterion id "17359491", text "app" and match type "BROAD" was found.

Keyword ad group criterion with ad group id "19839877629", criterion id "17359491", text "app" and match type "BROAD" was found.

Thanet Knack Praneenararat (AdWords API Team)

unread,
Apr 9, 2015, 11:46:58 AM4/9/15
to adwor...@googlegroups.com
Hi,

Please try using KeywordMatchType instead of MatchType in line 80 of the example
I'll make a note to ensure we update our examples accordingly.

Cheers,
Thanet

Chirag

unread,
Aug 20, 2015, 12:18:01 AM8/20/15
to AdWords API Forum
Hello Thanet,

I am using the KeywordMatchType still getting same keywords multiple time.

Please see the code :
$adGroupCriterionService =
      $user->GetService('AdGroupCriterionService', ADWORDS_VERSION);

  // Create selector.
  $selector = new Selector();
  $selector->fields = array('Id', 'CriteriaType', 'KeywordMatchType',
      'KeywordText','CpcBid','FirstPageCpc');
  $selector->ordering[] = new OrderBy('KeywordText', 'ASCENDING');

  // Create predicates.
  $selector->predicates[] = new Predicate('AdGroupId', 'IN', $adGroupId);
  $selector->predicates[] = new Predicate('CriteriaType', 'IN', array('KEYWORD'));

Please see my result.
Keyword with text 'book', match type 'BROAD', criteria type 'KEYWORD', and ID '10005230' was found. 
Keyword with text 'book', match type 'BROAD', criteria type 'KEYWORD', and ID '10005230' was found. 
Keyword with text 'book', match type 'BROAD', criteria type 'KEYWORD', and ID '10005230' was found. 
Keyword with text 'career', match type 'BROAD', criteria type 'KEYWORD', and ID '10346710' was found. 
Keyword with text 'career', match type 'BROAD', criteria type 'KEYWORD', and ID '10346710' was found. 
Keyword with text 'career', match type 'BROAD', criteria type 'KEYWORD', and ID '10346710' was found. 
Keyword with text 'careers', match type 'BROAD', criteria type 'KEYWORD', and ID '11904121' was found. 
Keyword with text 'careers', match type 'BROAD', criteria type 'KEYWORD', and ID '11904121' was found. 
Keyword with text 'careers', match type 'BROAD', criteria type 'KEYWORD', and ID '11904121' was found. 
Keyword with text 'certification', match type 'BROAD', criteria type 'KEYWORD', and ID '11904281' was found. 
Keyword with text 'certification', match type 'BROAD', criteria type 'KEYWORD', and ID '11904281' was found. 
Keyword with text 'certification', match type 'BROAD', criteria type 'KEYWORD', and ID '11904281' was found. 

Is that case, same keywords shared with multiple AdgroupId?

Please advice.

Thanks,

Thanet Knack Praneenararat (AdWords API Team)

unread,
Aug 20, 2015, 2:42:18 AM8/20/15
to AdWords API Forum
Hello,

Yes. Those keywords should be shared among many ad groups.
If you would like to confirm this, try adding AdGroupId in the selector fields and printing it out.

Cheers,
Thanet, AdWords API Team

Chirag

unread,
Aug 20, 2015, 5:46:55 AM8/20/15
to AdWords API Forum
Hello Thanet,

Yes, I have confirmed same.
There is any way to get only unique kws for all adgroups in one request?

Thanks

Thanet Knack Praneenararat (AdWords API Team)

unread,
Aug 20, 2015, 10:26:21 AM8/20/15
to AdWords API Forum
Hello,

To the best of my knowledge, we can't do anything with that because the Selector is aimed for returning all information.
You may need to implement the logic of filtering duplicate elements out from the list on your side.

Cheers,
Thanet, AdWords API Team

Chirag

unread,
Aug 21, 2015, 4:36:10 AM8/21/15
to AdWords API Forum
Ok, got your point.
Reply all
Reply to author
Forward
0 new messages