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

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


   * @return A {@link FeedItemOperation} for adding the feed item.
   */
  private static FeedItemOperation newSiteLinkFeedItemAddOperation(
      SiteLinksFeed siteLinksFeed, String text, String url) {
    // Create the FeedItemAttributeValues for our text values.
    FeedItemAttributeValue linkTextAttributeValue = new FeedItemAttributeValue();
    linkTextAttributeValue.setFeedAttributeId(siteLinksFeed.linkTextFeedAttributeId);
    linkTextAttributeValue.setStringValue(text);
    FeedItemAttributeValue linkUrlAttributeValue = new FeedItemAttributeValue();
    linkUrlAttributeValue.setFeedAttributeId(siteLinksFeed.linkUrlFeedAttributeId);
    linkUrlAttributeValue.setStringValue(url);

    // Create the feed item and operation.
    FeedItem item = new FeedItem();
    item.setFeedId(siteLinksFeed.siteLinksFeedId);
    item.setAttributeValues(
View Full Code Here


    // Create operation for adding each legacy sitelink to the sitelinks feed.
    List<FeedItemOperation> feedItemOperations = new ArrayList<FeedItemOperation>();

    for (Sitelink sitelink : sitelinks) {
      FeedItemOperation operation = newSiteLinkFeedItemAddOperation(
          siteLinksFeed, sitelink.getDisplayText(), sitelink.getDestinationUrl());
      feedItemOperations.add(operation);
    }

    FeedItemReturnValue result =
View Full Code Here

    // Create the feed item and operation.
    FeedItem item = new FeedItem();
    item.setFeedId(siteLinksFeed.siteLinksFeedId);
    item.setAttributeValues(
        new FeedItemAttributeValue[] {linkTextAttributeValue, linkUrlAttributeValue});
    FeedItemOperation operation = new FeedItemOperation();
    operation.setOperand(item);
    operation.setOperator(Operator.ADD);
    return operation;
  }
View Full Code Here

      FeedItemOperation operation = newSiteLinkFeedItemAddOperation(
          siteLinksFeed, sitelink.getDisplayText(), sitelink.getDestinationUrl());
      feedItemOperations.add(operation);
    }

    FeedItemReturnValue result =
        feedItemService.mutate(feedItemOperations.toArray(new FeedItemOperation[] {}));

    // Retrieve the feed item ids.
    for (FeedItem item : result.getValue()) {
      siteLinkFeedItemIds.add(item.getFeedItemId());
    }
    return siteLinkFeedItemIds;
  }
View Full Code Here

    FeedMappingServiceInterface feedMappingService =
        adWordsServices.get(session, FeedMappingServiceInterface.class);
    // Get the FeedService.
    FeedServiceInterface feedService = adWordsServices.get(session, FeedServiceInterface.class);
    // Get the FeedItemService.
    FeedItemServiceInterface feedItemService =
        adWordsServices.get(session, FeedItemServiceInterface.class);
    // Get the CampaignFeedService.
    CampaignFeedServiceInterface campaignFeedService =
        adWordsServices.get(session, CampaignFeedServiceInterface.class);
View Full Code Here

    AttributeFieldMapping linkUrlFieldMapping = new AttributeFieldMapping();
    linkUrlFieldMapping.setFeedAttributeId(siteLinksFeed.linkUrlFeedAttributeId);
    linkUrlFieldMapping.setFieldId(PLACEHOLDER_FIELD_SITELINK_URL);

    // Create the FieldMapping and operation.
    FeedMapping feedMapping = new FeedMapping();
    feedMapping.setPlaceholderType(PLACEHOLDER_SITELINKS);
    feedMapping.setFeedId(siteLinksFeed.siteLinksFeedId);
    feedMapping.setAttributeFieldMappings(
        new AttributeFieldMapping[] {linkTextFieldMapping, linkUrlFieldMapping});
    FeedMappingOperation operation = new FeedMappingOperation();
    operation.setOperand(feedMapping);
    operation.setOperator(Operator.ADD);
View Full Code Here

    // You can optionally provide these field(s).
    campaign.setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"));
    campaign.setStartDate(new DateTime().plusDays(30).toString("yyyyMMdd"));
    campaign.setAdServingOptimizationStatus(AdServingOptimizationStatus.ROTATE);
    campaign.setFrequencyCap(new FrequencyCap(5L, TimeUnit.DAY, Level.ADGROUP));

    // Only the budgetId should be sent, all other fields will be ignored by CampaignService.
    Budget budget = new Budget();
    budget.setBudgetId(budgetId);
    campaign.setBudget(budget);
View Full Code Here

    // Get the AdGroupCriterionService.
    AdGroupCriterionServiceInterface adGroupCriterionService =
        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);

    // https://developers.google.com/adwords/api/docs/appendix/genders
    Gender male = new Gender();
    male.setId(10L);
    BiddableAdGroupCriterion genderBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    genderBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    genderBiddableAdGroupCriterion.setCriterion(male);

    // https://developers.google.com/adwords/api/docs/appendix/ages
View Full Code Here

    networkSetting.setTargetContentNetwork(false);
    networkSetting.setTargetPartnerSearchNetwork(false);
    campaign.setNetworkSetting(networkSetting);

    // Set options that are not required.
    GeoTargetTypeSetting geoTarget = new GeoTargetTypeSetting();
    geoTarget.setPositiveGeoTargetType(GeoTargetTypeSettingPositiveGeoTargetType.DONT_CARE);
    KeywordMatchSetting keywordMatch = new KeywordMatchSetting();
    keywordMatch.setOptIn(Boolean.FALSE);
    campaign.setSettings(new Setting[] {geoTarget, keywordMatch});

    // You can create multiple campaigns in a single request.
View Full Code Here

          + ((RETRIES_COUNT - 1) * RETRY_INTERVAL) + " seconds.");
    }

    // Status must be COMPLETED.
    // Get the job result. Here we re-use the same selector.
    JobResult result = mutateJobService.getResult(selector);

    // Output results.
    int i = 0;
    for (Operand operand : result.getSimpleMutateResult().getResults()) {
      String outcome = operand.getPlaceHolder() == null ? "SUCCESS" : "FAILED";
      System.out.printf("Operation [%d] - %s\n", i++, outcome);
    }

    // Output errors.
    for (ApiError error : result.getSimpleMutateResult().getErrors()) {
      int index = getOperationIndex(error.getFieldPath());
      String reason = error.getErrorString();
      System.out.printf("ERROR - keyword '%s' failed due to '%s'\n",
          ((Keyword) operations.get(index).getOperand().getCriterion()).getText(), reason);
    }
View Full Code Here

TOP

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

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.