Package com.google.api.adwords.v201309.cm

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


      image.setData(
          ImageUtils.getImageDataFromUrl("https://sandbox.google.com/sandboximages/image.jpg"));
      imageAd.setImage(image);

      // Create ad group ad.
      AdGroupAd imageAdGroupAd = new AdGroupAd();
      imageAdGroupAd.setAdGroupId(adGroupId);
      imageAdGroupAd.setAd(imageAd);

      // Create operations.
      AdGroupAdOperation imageAdGroupAdOperation = new AdGroupAdOperation();
      imageAdGroupAdOperation.setOperand(imageAdGroupAd);
      imageAdGroupAdOperation.setOperator(Operator.ADD);
View Full Code Here


      // Set RichMedia ad type
      thirdPartyRedirectAd.setRichMediaAdType(RichMediaAdRichMediaAdType.fromValue("STANDARD"));

      // Create ad group ad.
      AdGroupAd adGroupAd = new AdGroupAd();
      adGroupAd.setAdGroupId(adGroupId);
      adGroupAd.setAd(thirdPartyRedirectAd);

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

      // Create In Stream ad.
      ThirdPartyRedirectAd inStreamAd = new ThirdPartyRedirectAd();
      inStreamAd.setName("Cruise to Mars #" + System.currentTimeMillis());
      inStreamAd.setUrl("http://www.example.com");
      inStreamAd.setSourceUrl("http://www.example.com");
      inStreamAd.setAdDuration(15000);
      inStreamAd.setUrl(
          "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml");
      inStreamAd.setCertifiedVendorFormatId(303L);
      inStreamAd.setRichMediaAdType(RichMediaAdRichMediaAdType.fromValue("IN_STREAM_VIDEO"));

      // Create ad group ad.
      AdGroupAd adGroupAd2 = new AdGroupAd();
      adGroupAd2.setAdGroupId(adGroupId);
      adGroupAd2.setAd(inStreamAd);

      // Create operations.
      AdGroupAdOperation adGroupAdOperation2 = new AdGroupAdOperation();
      adGroupAdOperation2.setOperand(adGroupAd2);
      adGroupAdOperation2.setOperator(Operator.ADD);
View Full Code Here

        new TemplateElementField[] {headline, description1, description2, appId, appStore});

    clickToDownloadAppAd.setTemplateElements(new TemplateElement[] {adData});

    // Create the AdGroupAd.
    AdGroupAd clickToDownloadAppAdGroupAd = new AdGroupAd();
    clickToDownloadAppAdGroupAd.setAdGroupId(adGroupId);
    clickToDownloadAppAdGroupAd.setAd(clickToDownloadAppAd);

    // Optional: Set the status.
    clickToDownloadAppAdGroupAd.setStatus(AdGroupAdStatus.PAUSED);

    // Create the operation.
    AdGroupAdOperation operation = new AdGroupAdOperation();
    operation.setOperator(Operator.ADD);
    operation.setOperand(clickToDownloadAppAdGroupAd);
View Full Code Here

      // Create ad with updated status.
      Ad ad = new Ad();
      ad.setId(adId);

      AdGroupAd adGroupAd = new AdGroupAd();
      adGroupAd.setAdGroupId(adGroupId);
      adGroupAd.setAd(ad);
      adGroupAd.setStatus(AdGroupAdStatus.PAUSED);

      // Create operations.
      AdGroupAdOperation operation = new AdGroupAdOperation();
      operation.setOperand(adGroupAd);
      operation.setOperator(Operator.SET);
View Full Code Here

      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);

      // Create image ad.
      ImageAd imageAd = new ImageAd();
      imageAd.setName("Cruise to mars image ad #" + System.currentTimeMillis());
      imageAd.setDisplayUrl("www.example.com");
      imageAd.setUrl("http://example.com");

      // Create image.
      Image image = new Image();
      image.setData(ImageUtils.getImageDataFromUrl("http://goo.gl/HJM3L"));
      imageAd.setImage(image);

      // Create ad group ad.
      AdGroupAd imageAdGroupAd = new AdGroupAd();
      imageAdGroupAd.setAdGroupId(adGroupId);
      imageAdGroupAd.setAd(imageAd);

      // Create template ad, using the Click to Play Video template (id 9).
      TemplateAd templateAd = new TemplateAd();
      templateAd.setTemplateId(9L);
      templateAd.setDimensions(new Dimensions(300, 250));
      templateAd.setName("Mars Cruise video ad #" + System.currentTimeMillis());
      templateAd.setDisplayUrl("www.example.com");
      templateAd.setUrl("http://www.example.com");

      // Create template ad data.
      Image startImage = new Image();
      startImage.setData(ImageUtils.getImageDataFromUrl("http://goo.gl/HJM3L"));
      startImage.setType(MediaMediaType.IMAGE);
      Video video = new Video();
      video.setMediaId(videoMediaId);
      video.setType(MediaMediaType.VIDEO);

      templateAd.setTemplateElements(new TemplateElement[] {
          new TemplateElement("adData", new TemplateElementField[] {
              new TemplateElementField("startImage", TemplateElementFieldType.IMAGE,
                  null, startImage),
              new TemplateElementField("displayUrlColor", TemplateElementFieldType.ENUM,
                  "#ffffff", null),
              new TemplateElementField("video", TemplateElementFieldType.VIDEO, null, video)})
      });

      // Create ad group ad.
      AdGroupAd templateAdGroupAd = new AdGroupAd();
      templateAdGroupAd.setAdGroupId(adGroupId);
      templateAdGroupAd.setAd(templateAd);

      // Create operations.
      AdGroupAdOperation textAdGroupAdOperation = new AdGroupAdOperation();
      textAdGroupAdOperation.setOperand(textAdGroupAd);
      textAdGroupAdOperation.setOperator(Operator.ADD);
View Full Code Here

      // Create base class ad to avoid setting type specific fields.
      Ad ad = new Ad();
      ad.setId(adId);

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

      // Create operations.
      AdGroupAdOperation operation = new AdGroupAdOperation();
      operation.setOperand(adGroupAd);
      operation.setOperator(Operator.REMOVE);
View Full Code Here

      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);

      // Create operations.
      AdGroupAdOperation nonExemptableOperation = new AdGroupAdOperation();
      nonExemptableOperation.setOperand(nonExemptableAdGroupAd);
      nonExemptableOperation.setOperator(Operator.ADD);
View Full Code Here

      image.setData(
          ImageUtils.getImageDataFromUrl("https://sandbox.google.com/sandboximages/image.jpg"));
      imageAd.setImage(image);

      // Create ad group ad.
      AdGroupAd imageAdGroupAd = new AdGroupAd();
      imageAdGroupAd.setAdGroupId(adGroupId);
      imageAdGroupAd.setAd(imageAd);

      // Create operations.
      AdGroupAdOperation imageAdGroupAdOperation = new AdGroupAdOperation();
      imageAdGroupAdOperation.setOperand(imageAdGroupAd);
      imageAdGroupAdOperation.setOperator(Operator.ADD);
View Full Code Here

      // Set RichMedia ad type
      thirdPartyRedirectAd.setRichMediaAdType(RichMediaAdRichMediaAdType.fromValue("STANDARD"));

      // Create ad group ad.
      AdGroupAd adGroupAd = new AdGroupAd();
      adGroupAd.setAdGroupId(adGroupId);
      adGroupAd.setAd(thirdPartyRedirectAd);

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

      // Create In Stream ad.
      ThirdPartyRedirectAd inStreamAd = new ThirdPartyRedirectAd();
      inStreamAd.setName("Cruise to Mars #" + System.currentTimeMillis());
      inStreamAd.setUrl("http://www.example.com");
      inStreamAd.setSourceUrl("http://www.example.com");
      inStreamAd.setAdDuration(15000);
      inStreamAd.setUrl(
          "http://ad.doubleclick.net/pfadx/N270.126913.6102203221521/B3876671.21;dcadv=2215309;sz=0x0;ord=%5btimestamp%5d;dcmt=text/xml");
      inStreamAd.setCertifiedVendorFormatId(303L);
      inStreamAd.setRichMediaAdType(RichMediaAdRichMediaAdType.fromValue("IN_STREAM_VIDEO"));

      // Create ad group ad.
      AdGroupAd adGroupAd2 = new AdGroupAd();
      adGroupAd2.setAdGroupId(adGroupId);
      adGroupAd2.setAd(inStreamAd);

      // Create operations.
      AdGroupAdOperation adGroupAdOperation2 = new AdGroupAdOperation();
      adGroupAdOperation2.setOperand(adGroupAd2);
      adGroupAdOperation2.setOperator(Operator.ADD);
View Full Code Here

      String query = String.format(
          "SELECT Id, AdGroupId, Status WHERE AdGroupId = %d AND Status = ACTIVE ORDER BY Id ",
          adGroupId);

      // Get all active ad group criteria.
      AdGroupCriterionPage page = adGroupCriterionService.query(query);

      // Display ad group criteria.
      if (page.getEntries() != null && page.getEntries().length > 0) {
        for (AdGroupCriterion adGroupCriterion : page.getEntries()) {
          if (adGroupCriterion instanceof BiddableAdGroupCriterion) {
            BiddableAdGroupCriterion biddableAdGroupCriterion =
                (BiddableAdGroupCriterion) adGroupCriterion;
            System.out.println("Ad group criterion with ad group id \""
                + biddableAdGroupCriterion.getAdGroupId() + "\", criterion id \""
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201309.cm.AdGroupAd

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.