Examples of TextAd


Examples of com.google.api.ads.adwords.axis.v201406.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.v201406.cm.TextAd

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

    // Create text ads.
    TextAd textAd = new TextAd();
    textAd.setHeadline("Luxury Cruise to Mars");
    textAd.setDescription1("Visit the Red Planet in style.");
    textAd.setDescription2("Low-gravity fun for everyone!");
    textAd.setDisplayUrl("www.example.com");
   
    // Specify a tracking url for 3rd party tracking provider. You may
    // specify one at customer, campaign, ad group, ad, criterion or
    // feed item levels.
    textAd.setTrackingUrlTemplate(
        "http://tracker.example.com/?cid={_season}&promocode={_promocode}&u={lpurl}");
   
    // Since your tracking url has two custom parameters, provide their
    // values too. This can be provided at campaign, ad group, ad, criterion
    // or feed item levels.
    CustomParameter seasonParameter = new CustomParameter();
    seasonParameter.setKey("season");
    seasonParameter.setValue("christmas");

    CustomParameter promoCodeParameter = new CustomParameter();
    promoCodeParameter.setKey("promocode");
    promoCodeParameter.setValue("NYC123");

    CustomParameters trackingUrlParameters = new CustomParameters();
    trackingUrlParameters.setParameters(
        new CustomParameter[] {seasonParameter, promoCodeParameter});
    textAd.setUrlCustomParameters(trackingUrlParameters);
   
    // Specify a list of final urls. This field cannot be set if url field is
    // set. This may be specified at ad, criterion, and feed item levels.
    textAd.setFinalUrls(new String[] {"http://www.example.com/cruise/space/",
        "http://www.example.com/locations/mars/"});
   
    // Specify a list of final mobile urls. This field cannot be set if url field is
    // set or finalUrls is not set. This may be specified at ad, criterion, and feed
    // item levels.
    textAd.setFinalMobileUrls(new String[] {"http://mobile.example.com/cruise/space/",
        "http://mobile.example.com/locations/mars/"});

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

Examples of com.google.api.ads.adwords.axis.v201406.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

    // 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.adwords.v200909.cm.TextAd

          adGroup = adGroupReturnValue.getValue()[0];
        }

        int numAds = generator.nextInt(10) + 1;
        for (int k = 0; k < numAds; k++) {
          TextAd ad = new TextAd();
          ad.setDescription1("This is the description");
          ad.setDescription2("Second line of the description");
          ad.setHeadline("This is the headline " + generator.nextInt(5000));
          ad.setDisplayUrl("http://google.com/");
          ad.setUrl("http://example.com");

          AdGroupAd adGroupAd = new AdGroupAd();
          adGroupAd.setAd(ad);
          adGroupAd.setAdGroupId(adGroup.getId());

          adGroupAdService.mutate(new AdGroupAdOperation[] {new AdGroupAdOperation(Operator.ADD,
              "ADD", adGroupAd, null)});
        }

        numAds = generator.nextInt(10) + 1;
        for (int k = 0; k < numAds; k++) {
          ImageAd ad = new ImageAd();
          Image image = new Image();
          image.setData(DataUtils.getTestImage());
          image.setName("name.jpg");
          ad.setImage(image);
          ad.setDisplayUrl("http://google.com/");
          ad.setUrl("http://example.com");
          ad.setName("name.jpg");

          AdGroupAd adGroupAd = new AdGroupAd();
          adGroupAd.setAd(ad);
          adGroupAd.setAdGroupId(adGroup.getId());
View Full Code Here

Examples of com.google.api.adwords.v201008.cm.TextAd

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        user.getService(AdWordsService.V201008.ADGROUP_AD_SERVICE);

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

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

Examples of com.google.api.adwords.v201008.cm.TextAd

  /**
   * Test adding an ad group ad.
   */
  public void testAdd() throws Exception {
    // Create text ad.
    TextAd textAd = new TextAd();
    textAd.setHeadline("Luxury Cruise to Mars");
    textAd.setDescription1("Visit the Red Planet in style.");
    textAd.setDescription2("Low-gravity fun for everyone!");
    textAd.setDisplayUrl("www.example.com");
    textAd.setUrl("http://www.example.com");

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

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

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

      // 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.adwords.v201306.cm.TextAd

      long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
      long videoMediaId = Long.parseLong("INSERT_VIDEO_MEDIA_ID_HERE");

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

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

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

      long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
      long videoMediaId = Long.parseLong("INSERT_VIDEO_MEDIA_ID_HERE");

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

      // Create ad group ad.
      AdGroupAd textAdGroupAd = new AdGroupAd();
      textAdGroupAd.setAdGroupId(adGroupId);
      textAdGroupAd.setAd(textAd);
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.