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

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


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

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201306.CONVERSION_TRACKER_SERVICE);

      // Replace with a valid value from your account.
      long conversionId = Long.parseLong("INSERT_CONVERSION_ID_HERE");

      // Create conversion with updated status and name.
      AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
      adWordsConversionTracker.setId(conversionId);
      adWordsConversionTracker.setStatus(ConversionTrackerStatus.DISABLED);

      // Create operations.
      ConversionTrackerOperation operation = new ConversionTrackerOperation();
      operation.setOperand(adWordsConversionTracker);
      operation.setOperator(Operator.SET);

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

      // Update conversion.
      ConversionTrackerReturnValue result = service.mutate(operations);

      // Display conversion.
      if (result != null && result.getValue() != null) {
        for (ConversionTracker conversionTracker : result.getValue()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
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

                        .getViolatingText());
                List<ExemptionRequest> exemptionRequests =
                    new ArrayList<ExemptionRequest>(Arrays
                        .asList(operation.getExemptionRequests() == null
                            ? new ExemptionRequest[] {} : operation.getExemptionRequests()));
                exemptionRequests.add(new ExemptionRequest(policyVioloationError.getKey()));
                operation
                    .setExemptionRequests(exemptionRequests.toArray(new ExemptionRequest[] {}));
              } else {
                // Remove non-exemptable operation.
                System.out.println("Removing non-exemptable operation at index " + operationIndex
View Full Code Here

          user.getService(AdWordsService.V201306.EXPERIMENT_SERVICE);

      long experimentId = Long.parseLong("INSERT_EXPERIMENT_ID_HERE");

      // Create experiment with PROMOTED status.
      Experiment experiment = new Experiment();
      experiment.setId(experimentId);
      experiment.setStatus(ExperimentStatus.PROMOTED);

      // Create operation.
      ExperimentOperation operation = new ExperimentOperation();
      operation.setOperand(experiment);
      operation.setOperator(Operator.SET);
View Full Code Here

      Experiment experiment = new Experiment();
      experiment.setId(experimentId);
      experiment.setStatus(ExperimentStatus.PROMOTED);

      // Create operation.
      ExperimentOperation operation = new ExperimentOperation();
      operation.setOperand(experiment);
      operation.setOperator(Operator.SET);

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

      // Promote experiment.
      ExperimentReturnValue result = experimentService.mutate(operations);
View Full Code Here

      operation.setOperator(Operator.SET);

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

      // Promote experiment.
      ExperimentReturnValue result = experimentService.mutate(operations);

      // Display experiments.
      if (result.getValue() != null) {
        for(Experiment experimentResult : result.getValue()) {
          System.out.println("Experiment with name \"" + experimentResult.getName()
              + "\" and id \"" + experimentResult.getId() + "\" was promoted.");
        }
      } else {
        System.out.println ("No experiments were promoted.");
View Full Code Here

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

      // Get the ExperimentService.
      ExperimentServiceInterface experimentService =
          user.getService(AdWordsService.V201306.EXPERIMENT_SERVICE);

      long experimentId = Long.parseLong("INSERT_EXPERIMENT_ID_HERE");

      // Create experiment with PROMOTED status.
      Experiment experiment = new Experiment();
      experiment.setId(experimentId);
      experiment.setStatus(ExperimentStatus.PROMOTED);

      // Create operation.
      ExperimentOperation operation = new ExperimentOperation();
      operation.setOperand(experiment);
      operation.setOperator(Operator.SET);

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

      // Promote experiment.
      ExperimentReturnValue result = experimentService.mutate(operations);

      // Display experiments.
      if (result.getValue() != null) {
        for(Experiment experimentResult : result.getValue()) {
          System.out.println("Experiment with name \"" + experimentResult.getName()
View Full Code Here

    // Replace the URL attribute for your own.
    urlAttribute.setName("Link URL");

    // Create the feed.
    Feed siteLinksFeed = new Feed();

    // Replace the feed name for your own.
    siteLinksFeed.setName("Feed For Sitelinks");
    siteLinksFeed.setAttributes(new FeedAttribute[] {textAttribute, urlAttribute});
    siteLinksFeed.setOrigin(FeedOrigin.USER);

    // Create operation.
    FeedOperation operation = new FeedOperation();
    operation.setOperand(siteLinksFeed);
    operation.setOperator(Operator.ADD);

    // Add the feed.
    FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation});

    Feed savedFeed = result.getValue()[0];
    siteLinksData.siteLinksFeedId = savedFeed.getId();
    FeedAttribute[] savedAttributes = savedFeed.getAttributes();
    siteLinksData.linkTextFeedAttributeId = savedAttributes[0].getId();
    siteLinksData.linkUrlFeedAttributeId = savedAttributes[1].getId();
    return siteLinksData;
  }
View Full Code Here

    FeedAttribute urlAttribute = new FeedAttribute();
    urlAttribute.setType(FeedAttributeType.URL);
    urlAttribute.setName("Link URL");

    // Create the feed.
    Feed siteLinksFeed = new Feed();
    siteLinksFeed.setName("Feed For Site Links");
    siteLinksFeed.setAttributes(new FeedAttribute[] {textAttribute, urlAttribute});
    siteLinksFeed.setOrigin(FeedOrigin.USER);

    // Create operation.
    FeedOperation operation = new FeedOperation();
    operation.setOperand(siteLinksFeed);
    operation.setOperator(Operator.ADD);

    // Add the feed.
    FeedReturnValue result = feedService.mutate(new FeedOperation[] {operation});

    Feed savedFeed = result.getValue()[0];
    siteLinksData.siteLinksFeedId = savedFeed.getId();
    FeedAttribute[] savedAttributes = savedFeed.getAttributes();
    siteLinksData.linkTextFeedAttributeId = savedAttributes[0].getId();
    siteLinksData.linkUrlFeedAttributeId = savedAttributes[1].getId();
    System.out.printf("Campaign with name %s and id %d with linkTextAttributeId %d"
        + " and linkUrlAttributeId %s was created.\n", savedFeed.getName(), savedFeed.getId(),
        savedAttributes[0].getId(), savedAttributes[1].getId());
  }
View Full Code Here

      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

TOP

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

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.