Package com.google.api.ads.adwords.jaxws.v201309.o

Examples of com.google.api.ads.adwords.jaxws.v201309.o.TargetingIdeaSelector


  /**
   * Test whether we can request placement type search parameter.
   */
  public void testGetPlacementTypeSearchParameter() throws Exception {
    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    PlacementTypeSearchParameter placementTypeSearchParameter =
        new PlacementTypeSearchParameter();
    SiteConstantsPlacementType[] types = {SiteConstantsPlacementType.VIDEO,
        SiteConstantsPlacementType.GAME};
    placementTypeSearchParameter.setPlacementTypes(types);

    RelatedToKeywordSearchParameter relatedToKeywordSearchParameter =
        new RelatedToKeywordSearchParameter();
    Keyword keyword = new Keyword();
    keyword.setText("iron man");
    keyword.setMatchType(KeywordMatchType.EXACT);
    relatedToKeywordSearchParameter.setKeywords(new Keyword[] {keyword});

    selector.setSearchParameters(new SearchParameter[] {
        placementTypeSearchParameter, relatedToKeywordSearchParameter});

    selector.setIdeaType(IdeaType.PLACEMENT);
    selector.setRequestType(RequestType.IDEAS);

    Paging paging = new Paging(0, 1);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
  }
View Full Code Here


  /**
   * Test whether we can request related keyword search parameter
   */
  public void testGetRelatedToKeywordSearchParameter() throws Exception {
    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    RelatedToKeywordSearchParameter relatedToKeywordSearchParameter =
        new RelatedToKeywordSearchParameter();
    Keyword keyword = new Keyword();
    keyword.setText("flowers");
    keyword.setMatchType(KeywordMatchType.EXACT);
    relatedToKeywordSearchParameter.setKeywords(new Keyword[] {keyword});

    selector.setSearchParameters(new SearchParameter[] {
        relatedToKeywordSearchParameter});
    selector.setIdeaType(IdeaType.KEYWORD);
    selector.setRequestType(RequestType.IDEAS);
    Paging paging = new Paging(0, 1);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
  }
View Full Code Here

   */
  public void testGetRelatedToKeywordSearchParameterAllPages() throws Exception {
    int index = 0;

    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    RelatedToKeywordSearchParameter relatedToKeywordSearchParameter =
        new RelatedToKeywordSearchParameter();
    Keyword keyword = new Keyword();
    keyword.setText("flowers");
    keyword.setMatchType(KeywordMatchType.BROAD);
    relatedToKeywordSearchParameter.setKeywords(new Keyword[] {keyword});

    selector.setSearchParameters(new SearchParameter[] {relatedToKeywordSearchParameter});

    selector.setIdeaType(IdeaType.KEYWORD);
    selector.setRequestType(RequestType.IDEAS);

    Paging paging = new Paging(index, 100);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
    ArrayList<TargetingIdea> result = new ArrayList<TargetingIdea>();

    while (paging.getStartIndex() + 100 <= page.getTotalNumEntries()) {
      assertNotNull(page);
      result.addAll(Arrays.asList(page.getEntries()));
      paging.setStartIndex(paging.getStartIndex() + 100);
      selector.setPaging(paging);
      page = service.get(selector);
    }
    assertEquals(page.getTotalNumEntries(), new Integer(result.size()));
  }
View Full Code Here

  /**
   * Test whether we can request related to url search parameter.
   */
  public void testGetRelatedToUrlSearchParameter() throws Exception {
    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    RelatedToUrlSearchParameter relatedToUrlSearchParameter =
        new RelatedToUrlSearchParameter();
    relatedToUrlSearchParameter.setUrls(new String[] {"http://finance.google.com"});

    selector.setSearchParameters(new SearchParameter[] {relatedToUrlSearchParameter});
    selector.setIdeaType(IdeaType.PLACEMENT);
    selector.setRequestType(RequestType.IDEAS);

    Paging paging = new Paging(0, 1);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
  }
View Full Code Here

  /**
   * Test whether we can request seed ad group id saerch parameter.
   */
  public void testGetSeedAdGroupIdSearchParameter() throws Exception {
    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    SeedAdGroupIdSearchParameter seedAdGroupIdSearchParameter =
        new SeedAdGroupIdSearchParameter(null, adGroupId);

    selector.setSearchParameters(new SearchParameter[] {seedAdGroupIdSearchParameter});
    selector.setIdeaType(IdeaType.KEYWORD);
    selector.setRequestType(RequestType.IDEAS);

    Paging paging = new Paging(0, 1);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
  }
View Full Code Here

  /**
   * Test whether we can request bulk keyword ideas.
   */
  public void testGetBulkKeywordIdeas() throws Exception {
    // Create selector and parameters.
    TargetingIdeaSelector selector = new TargetingIdeaSelector();

    RelatedToKeywordSearchParameter relatedToKeywordSearchParameter =
        new RelatedToKeywordSearchParameter();
    Keyword keyword = new Keyword();
    keyword.setText("presidential vote");
    keyword.setMatchType(KeywordMatchType.EXACT);
    relatedToKeywordSearchParameter.setKeywords(new Keyword[] {keyword});

    RelatedToUrlSearchParameter relatedToUrlSearchParameter =
        new RelatedToUrlSearchParameter();
    relatedToUrlSearchParameter.setUrls(new String[] {"http://finance.google.com"});

    selector.setSearchParameters(new SearchParameter[] {
      relatedToKeywordSearchParameter, relatedToUrlSearchParameter});

    selector.setIdeaType(IdeaType.KEYWORD);
    selector.setRequestType(RequestType.IDEAS);

    Paging paging = new Paging(0, 1);
    selector.setPaging(paging);

    TargetingIdeaPage page = service.get(selector);
  }
View Full Code Here

      // Get the TargetingIdeaService.
      TargetingIdeaServiceInterface targetingIdeaService =
          user.getService(AdWordsService.V201306.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});

      // Set selector paging (required for targeting idea service).
      Paging paging = new Paging();
      paging.setStartIndex(0);
      paging.setNumberResults(10);
      selector.setPaging(paging);

      // Language setting (optional).
      // The ID can be found in the documentation:
      //   https://developers.google.com/adwords/api/docs/appendix/languagecodes
      // Note: As of v201302, only a single language parameter is allowed.
      LanguageSearchParameter languageParameter = new LanguageSearchParameter();
      Language english = new Language();
      english.setId(1000L);
      languageParameter.setLanguages(new Language[] {english});

      // Create related to query search parameter.
      RelatedToQuerySearchParameter relatedToQuerySearchParameter =
          new RelatedToQuerySearchParameter();
      relatedToQuerySearchParameter.setQueries(new String[] {"mars cruise"});
      selector.setSearchParameters(
          new SearchParameter[] {relatedToQuerySearchParameter, languageParameter});

      // Get related keywords.
      TargetingIdeaPage page = targetingIdeaService.get(selector);
View Full Code Here

      // Create seed URL.
      String url = "mars.google.com";

      // Create selector.
      TargetingIdeaSelector selector = new TargetingIdeaSelector();
      selector.setRequestType(RequestType.IDEAS);
      selector.setIdeaType(IdeaType.PLACEMENT);
      selector.setRequestedAttributeTypes(new AttributeType[] {AttributeType.CRITERION,
          AttributeType.PLACEMENT_TYPE});

      // Set selector paging (required for targeting idea service).
      Paging paging = new Paging();
      paging.setStartIndex(0);
      paging.setNumberResults(10);
      selector.setPaging(paging);

      // Create related to URL search parameter.
      RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter();
      relatedToUrlSearchParameter.setUrls(new String[] {url});
      relatedToUrlSearchParameter.setIncludeSubUrls(false);
      selector.setSearchParameters(new SearchParameter[] {relatedToUrlSearchParameter});

      // Get related placements.
      TargetingIdeaPage page = targetingIdeaService.get(selector);

      // Display related placements.
View Full Code Here

      // Get the TargetingIdeaService.
      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});

      // Set selector paging (required for targeting idea service).
      Paging paging = new Paging();
      paging.setStartIndex(0);
      paging.setNumberResults(10);
      selector.setPaging(paging);

      // Language setting (optional).
      // The ID can be found in the documentation:
      //   https://developers.google.com/adwords/api/docs/appendix/languagecodes
      // Note: As of v201302, only a single language parameter is allowed.
      LanguageSearchParameter languageParameter = new LanguageSearchParameter();
      Language english = new Language();
      english.setId(1000L);
      languageParameter.setLanguages(new Language[] {english});

      // Create related to query search parameter.
      RelatedToQuerySearchParameter relatedToQuerySearchParameter =
          new RelatedToQuerySearchParameter();
      relatedToQuerySearchParameter.setQueries(new String[] {"mars cruise"});
      selector.setSearchParameters(
          new SearchParameter[] {relatedToQuerySearchParameter, languageParameter});

      // Get related keywords.
      TargetingIdeaPage page = targetingIdeaService.get(selector);
View Full Code Here

      // Create seed URL.
      String url = "mars.google.com";

      // Create selector.
      TargetingIdeaSelector selector = new TargetingIdeaSelector();
      selector.setRequestType(RequestType.IDEAS);
      selector.setIdeaType(IdeaType.PLACEMENT);
      selector.setRequestedAttributeTypes(new AttributeType[] {AttributeType.CRITERION,
          AttributeType.PLACEMENT_TYPE});

      // Set selector paging (required for targeting idea service).
      Paging paging = new Paging();
      paging.setStartIndex(0);
      paging.setNumberResults(10);
      selector.setPaging(paging);

      // Create related to URL search parameter.
      RelatedToUrlSearchParameter relatedToUrlSearchParameter = new RelatedToUrlSearchParameter();
      relatedToUrlSearchParameter.setUrls(new String[] {url});
      relatedToUrlSearchParameter.setIncludeSubUrls(false);
      selector.setSearchParameters(new SearchParameter[] {relatedToUrlSearchParameter});

      // Get related placements.
      TargetingIdeaPage page = targetingIdeaService.get(selector);

      // Display related placements.
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.o.TargetingIdeaSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.