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

Examples of com.google.api.ads.adwords.axis.v201402.cm.AdGroupAdServiceInterface


    CampaignCriterionServiceInterface campaignCriterionService =
        adWordsServices.get(session, CampaignCriterionServiceInterface.class);

    // Create locations. The IDs can be found in the documentation or
    // retrieved with the LocationCriterionService.
    Location california = new Location();
    california.setId(21137L);
    Location mexico = new Location();
    mexico.setId(2484L);

    // Create languages. The IDs can be found in the documentation or
    // retrieved with the ConstantDataService.
    Language english = new Language();
    english.setId(1000L);
View Full Code Here


  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, String[] locationNames)
      throws Exception {
    // Get the LocationCriterionService.
    LocationCriterionServiceInterface locationCriterionService =
        adWordsServices.get(session, LocationCriterionServiceInterface.class);

    Selector selector = new SelectorBuilder()
        .fields(
            "Id",
            "LocationName",
            "CanonicalName",
            "DisplayType",
            "ParentLocations",
            "Reach",
            "TargetingStatus")
        // Location names must match exactly, only EQUALS and IN are supported.
        .in("LocationName", locationNames)
        // Set the locale of the returned location names.
        .equals("Locale", "en")
        .build();

    // Make the get request.
    LocationCriterion[] locationCriteria = locationCriterionService.get(selector);

    // Display the resulting location criteria.
    for (LocationCriterion locationCriterion : locationCriteria) {
      String parentString =
          getParentLocationString(locationCriterion.getLocation().getParentLocations());
View Full Code Here

    spanish.setId(1003L);
   
    // Location groups criteria. These represent targeting by household income
    // or places of interest. The IDs can be found in the documentation or
    // retrieved with the LocationCriterionService.
    LocationGroups locationGroupTier3 = new LocationGroups();
    Function tier3MatchingFunction = new Function();
    tier3MatchingFunction.setLhsOperand(new FunctionArgumentOperand[] {
        // Tiers are numbered 1-10, and represent 10% segments of earners.
        // For example, TIER_1 is the top 10%, TIER_2 is the 80-90%, etc.
        // Tiers 6 through 10 are grouped into TIER_6_TO_10.
        new IncomeOperand(null, IncomeTier.TIER_3)
    });
    tier3MatchingFunction.setOperator(FunctionOperator.AND);
    tier3MatchingFunction.setRhsOperand(new FunctionArgumentOperand[] {
        new GeoTargetOperand(null, new long[]{ 1015116L }) // Miami, FL
    });
    locationGroupTier3.setMatchingFunction(tier3MatchingFunction);

    LocationGroups locationGroupDowntown = new LocationGroups();
    Function downtownMatchingFunction = new Function();
    downtownMatchingFunction.setLhsOperand(new FunctionArgumentOperand[] {
        new PlacesOfInterestOperand(null, PlacesOfInterestOperandCategory.DOWNTOWN)
    });
    downtownMatchingFunction.setOperator(FunctionOperator.AND);
    downtownMatchingFunction.setRhsOperand(new FunctionArgumentOperand[] {
        new GeoTargetOperand(null, new long[]{ 1015116L }) // Miami, FL
    });
    locationGroupDowntown.setMatchingFunction(downtownMatchingFunction);

    List<CampaignCriterionOperation> operations = new ArrayList<CampaignCriterionOperation>();
    for (Criterion criterion : new Criterion[] {california, mexico, english, spanish,
        locationGroupTier3, locationGroupDowntown}) {
      CampaignCriterionOperation operation = new CampaignCriterionOperation();
View Full Code Here

    campaign.setStatus(CampaignStatus.PAUSED);
    BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration();
    biddingStrategyConfiguration.setBiddingStrategyType(BiddingStrategyType.MANUAL_CPC);

    // You can optionally provide a bidding scheme in place of the type.
    ManualCpcBiddingScheme cpcBiddingScheme = new ManualCpcBiddingScheme();
    cpcBiddingScheme.setEnhancedCpcEnabled(false);
    biddingStrategyConfiguration.setBiddingScheme(cpcBiddingScheme);

    campaign.setBiddingStrategyConfiguration(biddingStrategyConfiguration);

    // You can optionally provide these field(s).
View Full Code Here

    genderBiddableAdGroupCriterion.setCriterion(male);

    // https://developers.google.com/adwords/api/docs/appendix/ages
    AgeRange undetermined = new AgeRange();
    undetermined.setId(503999L);
    NegativeAdGroupCriterion ageRangeNegativeAdGroupCriterion = new NegativeAdGroupCriterion();
    ageRangeNegativeAdGroupCriterion.setAdGroupId(adGroupId);
    ageRangeNegativeAdGroupCriterion.setCriterion(undetermined);

    AdGroupCriterionOperation genderAdGroupCriterionOperation = new AdGroupCriterionOperation();
    genderAdGroupCriterionOperation.setOperand(genderBiddableAdGroupCriterion);
    genderAdGroupCriterionOperation.setOperator(Operator.ADD);
    AdGroupCriterionOperation ageRangeNegativeAdGroupCriterionOperation =
View Full Code Here

    locationGroupTier3.setMatchingFunction(tier3MatchingFunction);

    LocationGroups locationGroupDowntown = new LocationGroups();
    Function downtownMatchingFunction = new Function();
    downtownMatchingFunction.setLhsOperand(new FunctionArgumentOperand[] {
        new PlacesOfInterestOperand(null, PlacesOfInterestOperandCategory.DOWNTOWN)
    });
    downtownMatchingFunction.setOperator(FunctionOperator.AND);
    downtownMatchingFunction.setRhsOperand(new FunctionArgumentOperand[] {
        new GeoTargetOperand(null, new long[]{ 1015116L }) // Miami, FL
    });
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session) throws Exception {
    // Get the ReportDefinitionService.
    ReportDefinitionServiceInterface reportDefinitionService =
        adWordsServices.get(session, ReportDefinitionServiceInterface.class);

    // Get report fields.
    ReportDefinitionField[] reportDefinitionFields =
        reportDefinitionService
            .getReportFields(ReportDefinitionReportType.KEYWORDS_PERFORMANCE_REPORT);

    // Display report fields.
    System.out.println("Available fields for report:");
View Full Code Here

      throws Exception {
    // Get the LocationCriterionService.
    LocationCriterionServiceInterface locationCriterionService =
        adWordsServices.get(session, LocationCriterionServiceInterface.class);

    Selector selector = new SelectorBuilder()
        .fields(
            "Id",
            "LocationName",
            "CanonicalName",
            "DisplayType",
View Full Code Here

    int offset = 0;

    // Create selector.
    SelectorBuilder builder = new SelectorBuilder();
    Selector selector = builder
        .fields(
            "CampaignId",
            "Id",
            "CriteriaType",
            "PlatformName",
View Full Code Here

   * Creates text ads that use ad customizations for the specified ad group IDs.
   */
  private static void createAdsWithCustomizations(AdWordsServices adWordsServices,
      AdWordsSession session, List<Long> adGroupIds) throws Exception {
    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    TextAd textAd = new TextAd();
    textAd.setHeadline("Luxury Cruise to {=CustomizerFeed.Name}");
    textAd.setDescription1("Only {=CustomizerFeed.Price}");
    textAd.setDescription2("Offer ends in {=countdown(CustomizerFeed.Date)}!");
    textAd.setUrl("http://www.example.com");
    textAd.setDisplayUrl("www.example.com");

    // We add the same ad to both ad groups. When they serve, they will show different values, since
    // they match different feed items.
    List<AdGroupAdOperation> adGroupAdOperations = Lists.newArrayList();
    for (Long adGroupId : adGroupIds) {
      AdGroupAd adGroupAd = new AdGroupAd();
      adGroupAd.setAdGroupId(adGroupId);
      adGroupAd.setAd(textAd);

      AdGroupAdOperation adGroupAdOperation = new AdGroupAdOperation();
      adGroupAdOperation.setOperand(adGroupAd);
      adGroupAdOperation.setOperator(Operator.ADD);

      adGroupAdOperations.add(adGroupAdOperation);
    }

    AdGroupAdReturnValue adGroupAdReturnValue = adGroupAdService.mutate(
        adGroupAdOperations.toArray(new AdGroupAdOperation[adGroupAdOperations.size()]));

    for (AdGroupAd addedAd : adGroupAdReturnValue.getValue()) {
      System.out.printf("Created an ad with ID %d, type '%s' and status '%s'.%n",
          addedAd.getAd().getId(), addedAd.getAd().getAdType(), addedAd.getStatus());
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201402.cm.AdGroupAdServiceInterface

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.