Package com.google.api.ads.adwords.axis.v201306.cm

Examples of com.google.api.ads.adwords.axis.v201306.cm.DataServiceInterface


    TrafficEstimatorSelector selector = new TrafficEstimatorSelector();
    selector.setCampaignEstimateRequests(campaignEstimateRequests
        .toArray(new CampaignEstimateRequest[] {}));

    // Get traffic estimates.
    TrafficEstimatorResult result = trafficEstimatorService.get(selector);

    // Display traffic estimates.
    if (result != null && result.getCampaignEstimates() != null) {
      KeywordEstimate[] keywordEstimates =
          result.getCampaignEstimates()[0].getAdGroupEstimates()[0].getKeywordEstimates();
      for (int i = 0; i < keywordEstimates.length; i++) {
        Keyword keyword = keywordEstimateRequests.get(i).getKeyword();
        KeywordEstimate keywordEstimate = keywordEstimates[i];
        if (Boolean.TRUE.equals(keywordEstimateRequests.get(i).getIsNegative())) {
          continue;
View Full Code Here


    english.setId(1000L);
    campaignEstimateRequest.setCriteria(new Criterion[] {unitedStates, english});
    campaignEstimateRequests.add(campaignEstimateRequest);

    // Create selector.
    TrafficEstimatorSelector selector = new TrafficEstimatorSelector();
    selector.setCampaignEstimateRequests(campaignEstimateRequests
        .toArray(new CampaignEstimateRequest[] {}));

    // Get traffic estimates.
    TrafficEstimatorResult result = trafficEstimatorService.get(selector);
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session) throws Exception {
    // Get the TrafficEstimatorService.
    TrafficEstimatorServiceInterface trafficEstimatorService =
        adWordsServices.get(session, TrafficEstimatorServiceInterface.class);

    // Create keywords. Up to 2000 keywords can be passed in a single request.
    List<Keyword> keywords = new ArrayList<Keyword>();
    keywords.add(new Keyword(null, null, null, "mars cruise", KeywordMatchType.BROAD));
    keywords.add(new Keyword(null, null, null, "cheap cruise", KeywordMatchType.PHRASE));
    keywords.add(new Keyword(null, null, null, "cruise", KeywordMatchType.EXACT));

    // Create a keyword estimate request for each keyword.
    List<KeywordEstimateRequest> keywordEstimateRequests = new ArrayList<KeywordEstimateRequest>();
    for (Keyword keyword : keywords) {
      KeywordEstimateRequest keywordEstimateRequest = new KeywordEstimateRequest();
      keywordEstimateRequest.setKeyword(keyword);
      keywordEstimateRequests.add(keywordEstimateRequest);
    }

    // Add a negative keyword to the traffic estimate.
    KeywordEstimateRequest negativeKeywordEstimateRequest = new KeywordEstimateRequest();
    negativeKeywordEstimateRequest.setKeyword(new Keyword(null, null, null, "hiking tour",
        KeywordMatchType.BROAD));
    negativeKeywordEstimateRequest.setIsNegative(true);
    keywordEstimateRequests.add(negativeKeywordEstimateRequest);

    // Create ad group estimate requests.
    List<AdGroupEstimateRequest> adGroupEstimateRequests = new ArrayList<AdGroupEstimateRequest>();
    AdGroupEstimateRequest adGroupEstimateRequest = new AdGroupEstimateRequest();
    adGroupEstimateRequest.setKeywordEstimateRequests(keywordEstimateRequests
        .toArray(new KeywordEstimateRequest[] {}));
    adGroupEstimateRequest.setMaxCpc(new Money(null, 1000000L));
    adGroupEstimateRequests.add(adGroupEstimateRequest);

    // Create campaign estimate requests.
    List<CampaignEstimateRequest> campaignEstimateRequests =
        new ArrayList<CampaignEstimateRequest>();
    CampaignEstimateRequest campaignEstimateRequest = new CampaignEstimateRequest();
    campaignEstimateRequest.setAdGroupEstimateRequests(adGroupEstimateRequests
        .toArray(new AdGroupEstimateRequest[] {}));
    Location unitedStates = new Location();
    unitedStates.setId(2840L);
    Language english = new Language();
    english.setId(1000L);
    campaignEstimateRequest.setCriteria(new Criterion[] {unitedStates, english});
    campaignEstimateRequests.add(campaignEstimateRequest);

    // Create selector.
    TrafficEstimatorSelector selector = new TrafficEstimatorSelector();
    selector.setCampaignEstimateRequests(campaignEstimateRequests
        .toArray(new CampaignEstimateRequest[] {}));

    // Get traffic estimates.
    TrafficEstimatorResult result = trafficEstimatorService.get(selector);

    // Display traffic estimates.
    if (result != null && result.getCampaignEstimates() != null) {
      KeywordEstimate[] keywordEstimates =
          result.getCampaignEstimates()[0].getAdGroupEstimates()[0].getKeywordEstimates();
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId,
      Long criterionId) throws Exception {
    // Get the DataService.
    DataServiceInterface dataService =
        adWordsServices.get(session, DataServiceInterface.class);

    // Create selector.
    Selector selector = new Selector();
    selector.setFields(new String[] {"AdGroupId", "CriterionId", "StartDate", "EndDate", "Bid",
        "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"});

    // Create predicates.
    Predicate adGroupIdPredicate =
        new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
    Predicate criterionIdPredicate =
        new Predicate("CriterionId", PredicateOperator.IN, new String[] {criterionId.toString()});
    selector.setPredicates(new Predicate[] {adGroupIdPredicate, criterionIdPredicate});

    // Get bid landscape for ad group criteria.
    CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);

    // Display bid landscapes.
    if (page.getEntries() != null) {
      for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
        System.out.println("Criterion bid landscape with ad group id \""
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId,
      Long criterionId) throws Exception {
    // Get the DataService.
    DataServiceInterface dataService =
        adWordsServices.get(session, DataServiceInterface.class);

    // Create selector.
    Selector selector = new SelectorBuilder()
        .fields(
            "AdGroupId",
            "CriterionId",
            "StartDate",
            "EndDate",
            "Bid",
            "LocalClicks",
            "LocalCost",
            "MarginalCpc",
            "LocalImpressions")
        .equals("AdGroupId", adGroupId.toString())
        .equals("CriterionId", criterionId.toString())
        .build();

    // Get bid landscape for ad group criteria.
    CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);

    // Display bid landscapes.
    if (page.getEntries() != null) {
      for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
        System.out.println("Criterion bid landscape with ad group id \""
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long adGroupId,
      Long criterionId) throws Exception {
    // Get the DataService.
    DataServiceInterface dataService =
        adWordsServices.get(session, DataServiceInterface.class);

    // Create selector.
    Selector selector = new SelectorBuilder()
        .fields(
            "AdGroupId",
            "CriterionId",
            "StartDate",
            "EndDate",
            "Bid",
            "LocalClicks",
            "LocalCost",
            "MarginalCpc",
            "LocalImpressions")
        .equals("AdGroupId", adGroupId.toString())
        .equals("CriterionId", criterionId.toString())
        .build();

    // Get bid landscape for ad group criteria.
    CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);

    // Display bid landscapes.
    if (page.getEntries() != null) {
      for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
        System.out.println("Criterion bid landscape with ad group id \""
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the DataService.
      DataServiceInterface dataService =
          user.getService(AdWordsService.V201306.DATA_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"AdGroupId", "LandscapeType", "LandscapeCurrent",
          "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc",
          "LocalImpressions"});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate});

      // Get bid landscape for ad group criteria.
      AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector);

      // Display bid landscapes.
      if (page.getEntries() != null) {
        for (AdGroupBidLandscape adGroupBidLandscape : page.getEntries()) {
          System.out.println("Ad group bid landscape with ad group id \""
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the DataService.
      DataServiceInterface dataService =
          user.getService(AdWordsService.V201306.DATA_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
      Long criterionId = Long.parseLong("INSERT_CRITERION_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"AdGroupId", "CriterionId", "StartDate", "EndDate",
          "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      Predicate criterionIdPredicate =
          new Predicate("CriterionId", PredicateOperator.IN, new String[] {criterionId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate, criterionIdPredicate});

      // Get bid landscape for ad group criteria.
      CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);

      // Display bid landscapes.
      if (page.getEntries() != null) {
        for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
          System.out.println("Criterion bid landscape with ad group id \""
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the DataService.
      DataServiceInterface dataService =
          user.getService(AdWordsService.V201309.DATA_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"AdGroupId", "LandscapeType", "LandscapeCurrent",
          "StartDate", "EndDate", "Bid", "LocalClicks", "LocalCost", "MarginalCpc",
          "LocalImpressions"});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate});

      // Get bid landscape for ad group criteria.
      AdGroupBidLandscapePage page = dataService.getAdGroupBidLandscape(selector);

      // Display bid landscapes.
      if (page.getEntries() != null) {
        for (AdGroupBidLandscape adGroupBidLandscape : page.getEntries()) {
          System.out.println("Ad group bid landscape with ad group id \""
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the DataService.
      DataServiceInterface dataService =
          user.getService(AdWordsService.V201309.DATA_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
      Long criterionId = Long.parseLong("INSERT_CRITERION_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"AdGroupId", "CriterionId", "StartDate", "EndDate",
          "Bid", "LocalClicks", "LocalCost", "MarginalCpc", "LocalImpressions"});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      Predicate criterionIdPredicate =
          new Predicate("CriterionId", PredicateOperator.IN, new String[] {criterionId.toString()});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate, criterionIdPredicate});

      // Get bid landscape for ad group criteria.
      CriterionBidLandscapePage page = dataService.getCriterionBidLandscape(selector);

      // Display bid landscapes.
      if (page.getEntries() != null) {
        for (CriterionBidLandscape criterionBidLandscape : page.getEntries()) {
          System.out.println("Criterion bid landscape with ad group id \""
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201306.cm.DataServiceInterface

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.