Exclude categorieds from keywords results

93 views
Skip to first unread message

sada vemula

unread,
Apr 5, 2014, 5:14:11 AM4/5/14
to adwor...@googlegroups.com
Please let me know, how to filter results by categore wise . some body post sample code in java for TargetingIdeaSelector service

Danial Klimkin

unread,
Apr 7, 2014, 9:52:16 AM4/7/14
to adwor...@googlegroups.com
Hello Sada,


I am sorry I don't fully understand your question. Can you please provide more details?


-Danial, AdWords API Team.

sadanandam v

unread,
Apr 8, 2014, 12:32:33 AM4/8/14
to adwordsapiad...@google.com, adwor...@googlegroups.com
Hi Danial,

  By using  Adwords API , We get related keywords by input keyword using TargetingIdeaSelector  service , In that scenario ,i want keywords by category wise .. I've some block listed categories , I don't want related keywords  for those categories from Paging objects .

Thanks,
Sadanandam 


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/eg0EVf0SR1k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Danial Klimkin

unread,
Apr 8, 2014, 9:20:14 AM4/8/14
to adwor...@googlegroups.com
Hello Sadanandam,


No, there is no exclude parameter of this type in TIS. There is one for inclusion though:



-Danial, AdWords API Team.


On Tuesday, April 8, 2014 8:32:33 AM UTC+4, sada vemula wrote:
Hi Danial,

  By using  Adwords API , We get related keywords by input keyword using TargetingIdeaSelector  service , In that scenario ,i want keywords by category wise .. I've some block listed categories , I don't want related keywords  for those categories from Paging objects .

Thanks,
Sadanandam 

sada vemula

unread,
Apr 9, 2014, 1:27:53 PM4/9/14
to adwor...@googlegroups.com

Hi Danial,
 
 I've added  multiple CategoryProductsAndServicesSearchParameter objects to TargetingIdeaSelector .

  Example code :
    CategoryProductsAndServicesSearchParameter category1= new CategoryProductsAndServicesSearchParameter();
category.setCategoryId(10177);

   CategoryProductsAndServicesSearchParameter category2= new CategoryProductsAndServicesSearchParameter();
category.setCategoryId(13409);  ...ect

 TargetingIdeaSelector . setSearchParameters(new SearchParameter[] {
   category1,category2 ...etc
})
  
 but am getting an exception . Can you please rectify this.

 question : how to add multiple categories ids to TargetingIdeaSelector .


Thanks,
Sada

Danial Klimkin

unread,
Apr 10, 2014, 7:52:36 AM4/10/14
to adwor...@googlegroups.com
Hello Sada,


What is the error message you are getting?


-Danial, AdWords API Team.

sada vemula

unread,
Apr 10, 2014, 9:28:53 AM4/10/14
to adwor...@googlegroups.com
 Exceptions like : INVALID_INCLUDED_EXCLUDED_KEYWORDS,
             DUPLICATE_SEARCH_FILTER_TYPES_PRESENT   
 
  QUESTION : Do we add multiple CategoryProductsAndServicesSearchParameter objects to  SearchParameter ? (Please answer this)
 
   Please let us know , where is the mistake in the code.


     TargetingIdeaServiceInterface targetingIdeaService =
     user.getService(AdWordsService.V201309.TARGETING_IDEA_SERVICE);
     // Create selector.
     TargetingIdeaSelector selector = new TargetingIdeaSelector();
     selector.setRequestType(RequestType.IDEAS);
      selector.setIdeaType(IdeaType.KEYWORD);
      selector.setRequestedAttributeTypes(new AttributeType[] {
          AttributeType.KEYWORD_TEXT,
          AttributeType.SEARCH_VOLUME,
          AttributeType.CATEGORY_PRODUCTS_AND_SERVICES,
          AttributeType.COMPETITION
      });
     
        Paging paging = new Paging();
        paging.setStartIndex(0);
        paging.setNumberResults(10);
        selector.setPaging(paging);

        LanguageSearchParameter languageParameter = new LanguageSearchParameter();
        Language english = new Language();
        english.setId(1000L);
        languageParameter.setLanguages(new Language[] {english});

        // Preffered  US Loaction
        Location location = new Location();
        location.setId(2840L);
        LocationSearchParameter locationSearchParameter = new LocationSearchParameter();
        locationSearchParameter.setLocations(new Location[]{location});
     
        ExcludedKeywordSearchParameter excludedKeywordSearchParameter =
            new ExcludedKeywordSearchParameter();
        Keyword keyword1 = new Keyword();
        keyword1.setText("mars cruise");
        keyword1.setMatchType(KeywordMatchType.EXACT); 
        excludedKeywordSearchParameter.setKeywords(new Keyword[] {keyword1}); 
               
        IdeaTextFilterSearchParameter ideaTextMatchesSearchParameter =
            new IdeaTextFilterSearchParameter();
        ideaTextMatchesSearchParameter.setIncluded(new String[] {"mars cruise"});
     
        // Create related to query search parameter.
        RelatedToQuerySearchParameter relatedToQuerySearchParameter =
            new RelatedToQuerySearchParameter();
        relatedToQuerySearchParameter.setQueries(new String[] {"mars cruise"});
       
      //we can request competition search parameter.
        CompetitionSearchParameter competitionSearchParameter = new CompetitionSearchParameter();
        CompetitionSearchParameterLevel[] levels = {CompetitionSearchParameterLevel.MEDIUM,
            CompetitionSearchParameterLevel.HIGH};
        competitionSearchParameter.setLevels(levels);

        CategoryProductsAndServicesSearchParameter category1 =
             new CategoryProductsAndServicesSearchParameter(); 
        category1.setCategoryId(10021);

        CategoryProductsAndServicesSearchParameter category2 =
            new CategoryProductsAndServicesSearchParameter(); 
       category2.setCategoryId(10005);

       CategoryProductsAndServicesSearchParameter category3 =
           new CategoryProductsAndServicesSearchParameter(); 
      category3.setCategoryId(10004);

      CategoryProductsAndServicesSearchParameter category4 =
          new CategoryProductsAndServicesSearchParameter(); 
      category4.setCategoryId(10019);

      CategoryProductsAndServicesSearchParameter category5 =
         new CategoryProductsAndServicesSearchParameter(); 
      category5.setCategoryId(10020);

      CategoryProductsAndServicesSearchParameter category6 =
          new CategoryProductsAndServicesSearchParameter(); 
       category6.setCategoryId(10010);
  
        selector.setSearchParameters(new SearchParameter[] {
            relatedToQuerySearchParameter,
            languageParameter,
            locationSearchParameter,          
            excludedKeywordSearchParameter,
            competitionSearchParameter,
            ideaTextMatchesSearchParameter,
            category1,category2,category3,category4,category5,category6           
            });

      selector.setLocaleCode("US");
      TargetingIdeaPage page = targetingIdeaService.get(selector);

  System.out.println(selector +"\n"+page.getEntries().length);  
  .... etc
  

Danial Klimkin

unread,
Apr 11, 2014, 9:09:29 AM4/11/14
to adwor...@googlegroups.com
Hello Sada,


As per the first error, you are excluding the same keyword you are looking up for.

I am currently checking if multiple CategoryProductsAndServicesSearchParameters are allowed.


-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages