Examples of TextAd


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

    // Get the validation AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdValidationService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");

    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
    textAdGroupAd1.setAd(textAd1);

    // Create operations.
    AdGroupAdOperation textAdGroupAdOperation1 = new AdGroupAdOperation();
    textAdGroupAdOperation1.setOperand(textAdGroupAd1);
    textAdGroupAdOperation1.setOperator(Operator.ADD);

    AdGroupAdOperation[] operations = new AdGroupAdOperation[] {textAdGroupAdOperation1};

    // Add ads.
    AdGroupAdReturnValue result = adGroupAdValidationService.mutate(operations);
    // No error means the request is valid.

    // Now let's check an invalid ad using a very long line to trigger an error.
    textAd1.setDescription2("Low-gravity fun for all astronauts in orbit.");

    try {
      adGroupAdValidationService.mutate(operations);
    } catch (ApiException e) {
      System.err.println("Validation failed for reason \"" + e.getMessage1() + "\".");
View Full Code Here

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

    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad that violates an exemptable policy. This ad will only
    // trigger an error in the production environment.
    TextAd exemptableTextAd = new TextAd();
    exemptableTextAd.setHeadline("Mars " + System.currentTimeMillis() + "!!!");
    exemptableTextAd.setDescription1("Visit the Red Planet in style.");
    exemptableTextAd.setDescription2("Low-gravity fun for everyone!");
    exemptableTextAd.setDisplayUrl("www.example.com");
    exemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd exemptableAdGroupAd = new AdGroupAd();
    exemptableAdGroupAd.setAdGroupId(adGroupId);
    exemptableAdGroupAd.setAd(exemptableTextAd);

    // Create operations.
    AdGroupAdOperation exemptableOperation = new AdGroupAdOperation();
    exemptableOperation.setOperand(exemptableAdGroupAd);
    exemptableOperation.setOperator(Operator.ADD);

    // Create text ad that violates an non-exemptable policy.
    TextAd nonExemptableTextAd = new TextAd();
    nonExemptableTextAd.setHeadline("Mars Cruise with too long of a headline.");
    nonExemptableTextAd.setDescription1("Visit the Red Planet in style.");
    nonExemptableTextAd.setDescription2("Low-gravity fun for everyone.");
    nonExemptableTextAd.setDisplayUrl("www.example.com");
    nonExemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd nonExemptableAdGroupAd = new AdGroupAd();
    nonExemptableAdGroupAd.setAdGroupId(adGroupId);
    nonExemptableAdGroupAd.setAd(nonExemptableTextAd);
View Full Code Here

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

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");
    TextAd textAd2 = new TextAd();
    textAd2.setHeadline("Luxury Cruise to Mars");
    textAd2.setDescription1("Enjoy your stay at Red Planet.");
    textAd2.setDescription2("Buy your tickets now!");
    textAd2.setDisplayUrl("www.example.com");
    textAd2.setUrl("http://www.example.com");


    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.TextAd

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");
    TextAd textAd2 = new TextAd();
    textAd2.setHeadline("Luxury Cruise to Mars");
    textAd2.setDescription1("Enjoy your stay at Red Planet.");
    textAd2.setDescription2("Buy your tickets now!");
    textAd2.setDisplayUrl("www.example.com");
    textAd2.setUrl("http://www.example.com");


    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.TextAd

    // Get the validation AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdValidationService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");

    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
    textAdGroupAd1.setAd(textAd1);

    // Create operations.
    AdGroupAdOperation textAdGroupAdOperation1 = new AdGroupAdOperation();
    textAdGroupAdOperation1.setOperand(textAdGroupAd1);
    textAdGroupAdOperation1.setOperator(Operator.ADD);

    AdGroupAdOperation[] operations = new AdGroupAdOperation[] {textAdGroupAdOperation1};

    // Add ads.
    AdGroupAdReturnValue result = adGroupAdValidationService.mutate(operations);
    // No error means the request is valid.

    // Now let's check an invalid ad using a very long line to trigger an error.
    textAd1.setDescription2("Low-gravity fun for all astronauts in orbit.");

    try {
      adGroupAdValidationService.mutate(operations);
    } catch (ApiException e) {
      System.err.println("Validation failed for reason \"" + e.getMessage1() + "\".");
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201309.cm.TextAd

    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad that violates an exemptable policy. This ad will only
    // trigger an error in the production environment.
    TextAd exemptableTextAd = new TextAd();
    exemptableTextAd.setHeadline("Mars " + System.currentTimeMillis() + "!!!");
    exemptableTextAd.setDescription1("Visit the Red Planet in style.");
    exemptableTextAd.setDescription2("Low-gravity fun for everyone!");
    exemptableTextAd.setDisplayUrl("www.example.com");
    exemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd exemptableAdGroupAd = new AdGroupAd();
    exemptableAdGroupAd.setAdGroupId(adGroupId);
    exemptableAdGroupAd.setAd(exemptableTextAd);

    // Create operations.
    AdGroupAdOperation exemptableOperation = new AdGroupAdOperation();
    exemptableOperation.setOperand(exemptableAdGroupAd);
    exemptableOperation.setOperator(Operator.ADD);

    // Create text ad that violates an non-exemptable policy.
    TextAd nonExemptableTextAd = new TextAd();
    nonExemptableTextAd.setHeadline("Mars Cruise with too long of a headline.");
    nonExemptableTextAd.setDescription1("Visit the Red Planet in style.");
    nonExemptableTextAd.setDescription2("Low-gravity fun for everyone.");
    nonExemptableTextAd.setDisplayUrl("www.example.com");
    nonExemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd nonExemptableAdGroupAd = new AdGroupAd();
    nonExemptableAdGroupAd.setAdGroupId(adGroupId);
    nonExemptableAdGroupAd.setAd(nonExemptableTextAd);
View Full Code Here

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

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");
    TextAd textAd2 = new TextAd();
    textAd2.setHeadline("Luxury Cruise to Mars");
    textAd2.setDescription1("Enjoy your stay at Red Planet.");
    textAd2.setDescription2("Buy your tickets now!");
    textAd2.setDisplayUrl("www.example.com");
    textAd2.setUrl("http://www.example.com");


    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
View Full Code Here

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

    AdGroupAdServiceInterface adGroupAdService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad that violates an exemptable policy. This ad will only
    // trigger an error in the production environment.
    TextAd exemptableTextAd = new TextAd();
    exemptableTextAd.setHeadline("Mars " + System.currentTimeMillis() + "!!!");
    exemptableTextAd.setDescription1("Visit the Red Planet in style.");
    exemptableTextAd.setDescription2("Low-gravity fun for everyone!");
    exemptableTextAd.setDisplayUrl("www.example.com");
    exemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd exemptableAdGroupAd = new AdGroupAd();
    exemptableAdGroupAd.setAdGroupId(adGroupId);
    exemptableAdGroupAd.setAd(exemptableTextAd);

    // Create operations.
    AdGroupAdOperation exemptableOperation = new AdGroupAdOperation();
    exemptableOperation.setOperand(exemptableAdGroupAd);
    exemptableOperation.setOperator(Operator.ADD);

    // Create text ad that violates an non-exemptable policy.
    TextAd nonExemptableTextAd = new TextAd();
    nonExemptableTextAd.setHeadline("Mars Cruise with too long of a headline.");
    nonExemptableTextAd.setDescription1("Visit the Red Planet in style.");
    nonExemptableTextAd.setDescription2("Low-gravity fun for everyone.");
    nonExemptableTextAd.setDisplayUrl("www.example.com");
    nonExemptableTextAd.setUrl("http://www.example.com/");

    // Create ad group ad.
    AdGroupAd nonExemptableAdGroupAd = new AdGroupAd();
    nonExemptableAdGroupAd.setAdGroupId(adGroupId);
    nonExemptableAdGroupAd.setAd(nonExemptableTextAd);
View Full Code Here

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

    // Get the validation AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdValidationService =
        adWordsServices.get(session, AdGroupAdServiceInterface.class);

    // Create text ad.
    TextAd textAd1 = new TextAd();
    textAd1.setHeadline("Luxury Cruise to Mars");
    textAd1.setDescription1("Visit the Red Planet in style.");
    textAd1.setDescription2("Low-gravity fun for everyone!");
    textAd1.setDisplayUrl("www.example.com");
    textAd1.setUrl("http://www.example.com");

    // Create ad group ad.
    AdGroupAd textAdGroupAd1 = new AdGroupAd();
    textAdGroupAd1.setAdGroupId(adGroupId);
    textAdGroupAd1.setAd(textAd1);

    // Create operations.
    AdGroupAdOperation textAdGroupAdOperation1 = new AdGroupAdOperation();
    textAdGroupAdOperation1.setOperand(textAdGroupAd1);
    textAdGroupAdOperation1.setOperator(Operator.ADD);

    AdGroupAdOperation[] operations = new AdGroupAdOperation[] {textAdGroupAdOperation1};

    // Add ads.
    AdGroupAdReturnValue result = adGroupAdValidationService.mutate(operations);
    // No error means the request is valid.

    // Now let's check an invalid ad using a very long line to trigger an error.
    textAd1.setDescription2("Low-gravity fun for all astronauts in orbit.");

    try {
      adGroupAdValidationService.mutate(operations);
    } catch (ApiException e) {
      System.err.println("Validation failed for reason \"" + e.getMessage1() + "\".");
View Full Code Here

Examples of com.google.api.ads.adwords.axis.v201406.cm.TextAd

      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) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.