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

Examples of com.google.api.adwords.v201306.cm.CampaignServiceInterface


      Address address3 = new Address();
      address3.setStreetAddress("五四大街1号, Beijing东城区");
      address3.setCountryCode("CN");

      // Create selector.
      GeoLocationSelector selector = new GeoLocationSelector();
      selector.setAddresses(new Address[] {address1, address2, address3});

      // Get geo locations.
      GeoLocation[] locations = geoLocationService.get(selector);

      // Display geo locations.
View Full Code Here


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

      // Get the GeoLocationService.
      GeoLocationServiceInterface geoLocationService =
          user.getService(AdWordsService.V201306.GEO_LOCATION_SERVICE);

      // Create addresses.
      Address address1 = new Address();
      address1.setStreetAddress("1600 Amphitheatre Pkwy");
      address1.setCityName("Mountain View");
      address1.setProvinceCode("US-CA");
      address1.setPostalCode("94043");
      address1.setCountryCode("US");

      Address address2 = new Address();
      address2.setStreetAddress("76 9th Ave");
      address2.setCityName("New York");
      address2.setProvinceCode("US-NY");
      address2.setPostalCode("10011");
      address2.setCountryCode("US");

      Address address3 = new Address();
      address3.setStreetAddress("五四大街1号, Beijing东城区");
      address3.setCountryCode("CN");

      // Create selector.
      GeoLocationSelector selector = new GeoLocationSelector();
      selector.setAddresses(new Address[] {address1, address2, address3});

      // Get geo locations.
      GeoLocation[] locations = geoLocationService.get(selector);

      // Display geo locations.
      if (locations != null) {
        for (GeoLocation location : locations) {
          if (location instanceof InvalidGeoLocation) {
View Full Code Here

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

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate statusPredicate =
          new Predicate("Status", PredicateOperator.IN, new String[] {"ACTIVE"});
      Predicate adGroupIdPredicate =
View Full Code Here

      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

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

      // Get all active ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);
View Full Code Here

      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);
View Full Code Here

          user.getService(AdWordsService.V201306.ADGROUP_CRITERION_SERVICE);

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

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "AdGroupId", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

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

      // Get all active ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.get(selector);

      // Display ad group criteria.
View Full Code Here

          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.
View Full Code Here

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

      // Get the CampaignService.
      CampaignServiceInterface campaignService =
          user.getService(AdWordsService.V201309.CAMPAIGN_SERVICE);

      long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create campaign with updated budget.
      Campaign campaign = new Campaign();
      campaign.setId(campaignId);
      campaign.setStatus(CampaignStatus.PAUSED);

      // Create operations.
      CampaignOperation operation = new CampaignOperation();
      operation.setOperand(campaign);
      operation.setOperator(Operator.SET);

      CampaignOperation[] operations = new CampaignOperation[] {operation};

      // Update campaign.
      CampaignReturnValue result = campaignService.mutate(operations);

      // Display campaigns.
      if (result != null && result.getValue() != null) {
        for (Campaign campaignResult : result.getValue()) {
          System.out.println("Campaign with name \"" + campaignResult.getName() + "\", id \""
View Full Code Here

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

      // Get the CampaignService.
      CampaignServiceInterface campaignService =
          user.getService(AdWordsService.V201309.CAMPAIGN_SERVICE);

      String query = "SELECT Id, Name, Status ORDER BY Name";
      // Get all campaigns.
      CampaignPage page = campaignService.query(query);

      // Display campaigns.
      if (page.getEntries() != null) {
        for (Campaign campaign : page.getEntries()) {
          System.out.println("Campaign with name \"" + campaign.getName() + "\" and id \""
View Full Code Here

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

      // Get the CampaignService.
      CampaignServiceInterface campaignService =
          user.getService(AdWordsService.V201309.CAMPAIGN_SERVICE);

      long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create campaign with DELETED status.
      Campaign campaign = new Campaign();
      campaign.setId(campaignId);
      campaign.setStatus(CampaignStatus.DELETED);

      // Create operations.
      CampaignOperation operation = new CampaignOperation();
      operation.setOperand(campaign);
      operation.setOperator(Operator.SET);

      CampaignOperation[] operations = new CampaignOperation[] {operation};

      // Delete campaign.
      CampaignReturnValue result = campaignService.mutate(operations);

      // Display campaigns.
      if (result != null && result.getValue() != null) {
        for (Campaign campaignResult : result.getValue()) {
          System.out.println("Campaign with name \"" + campaignResult.getName() + "\" and id \""
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201306.cm.CampaignServiceInterface

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.