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

Examples of com.google.api.ads.adwords.jaxws.v201309.cm.ThirdPartyRedirectAd


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

    // Create third party redirect ad.
    ThirdPartyRedirectAd thirdPartyRedirectAd = new ThirdPartyRedirectAd();
    thirdPartyRedirectAd.setName("Example third party ad #" + System.currentTimeMillis());
    thirdPartyRedirectAd.setUrl("http://www.example.com");
    thirdPartyRedirectAd.setDimensions(new Dimensions(300, 250));
    // This field normally contains the javascript ad tag.
    thirdPartyRedirectAd.setSnippet("<img src=\"http://goo.gl/HJM3L\"/>");
    // DoubleClick Rich Media Expandable format ID.
    thirdPartyRedirectAd.setCertifiedVendorFormatId(232L);
    thirdPartyRedirectAd.setIsCookieTargeted(false);
    thirdPartyRedirectAd.setIsUserInterestTargeted(false);
    thirdPartyRedirectAd.setIsTagged(false);

    thirdPartyRedirectAd.setExpandingDirections(new ThirdPartyRedirectAdExpandingDirection[] {
        ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP,
        ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN});
    thirdPartyRedirectAd.setAdAttributes(
        new RichMediaAdAdAttribute[] {RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND});

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

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

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


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

    // Create third party redirect ad.
    ThirdPartyRedirectAd thirdPartyRedirectAd = new ThirdPartyRedirectAd();
    thirdPartyRedirectAd.setName("Example third party ad #" + System.currentTimeMillis());
    thirdPartyRedirectAd.setUrl("http://www.example.com");
    thirdPartyRedirectAd.setDimensions(new Dimensions(300, 250));
    // This field normally contains the javascript ad tag.
    thirdPartyRedirectAd.setSnippet("<img src=\"http://goo.gl/HJM3L\"/>");
    // DoubleClick Rich Media Expandable format ID.
    thirdPartyRedirectAd.setCertifiedVendorFormatId(232L);
    thirdPartyRedirectAd.setIsCookieTargeted(false);
    thirdPartyRedirectAd.setIsUserInterestTargeted(false);
    thirdPartyRedirectAd.setIsTagged(false);

    thirdPartyRedirectAd.setExpandingDirections(new ThirdPartyRedirectAdExpandingDirection[] {
        ThirdPartyRedirectAdExpandingDirection.EXPANDING_UP,
        ThirdPartyRedirectAdExpandingDirection.EXPANDING_DOWN});
    thirdPartyRedirectAd.setAdAttributes(
        new RichMediaAdAdAttribute[] {RichMediaAdAdAttribute.ROLL_OVER_TO_EXPAND});

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

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

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

    selectorCopy.getFields().addAll(Sets.newLinkedHashSet(this.fields));
    selectorCopy.getOrdering().addAll(orderingCopy);
    selectorCopy.getPredicates().addAll(predicatesCopy);

    if (this.dateRange != null) {
      DateRange newDateRange = new DateRange();
      newDateRange.setMin(this.dateRange.getMin());
      newDateRange.setMax(this.dateRange.getMax());
      selectorCopy.setDateRange(newDateRange);
    }
    if (this.paging != null) {
      Paging newPaging = new Paging();
      newPaging.setStartIndex(this.paging.getStartIndex());
View Full Code Here

   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder forDateRange(DateTime start, DateTime end) {
    if (this.dateRange == null) {
      this.dateRange = new DateRange();
    }
    DateFormat dateFormat = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
    if (start != null) {
      this.dateRange.setMin(dateFormat.format(start.toDate()));
    }
View Full Code Here

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEnd);

    String formatEndPlusOne = dateFormat.format(end.plusDays(1).toDate());

    DateRange dateRange = new DateRange();
    dateRange.setMin(formatStart);
    dateRange.setMax(formatEndPlusOne);

    selector.setDateRange(dateRange);

    Assert.assertEquals(selector.getDateRange().getMin(), formatStart);
    Assert.assertEquals(selector.getDateRange().getMax(), formatEndPlusOne);
View Full Code Here

   * @return the new set of OrderBy objects with different instance for each of the OrderBy
   */
  private Set<OrderBy> copyOrderingSet() {
    Set<OrderBy> orderingCopy = Sets.newLinkedHashSet();
    for (OrderBy order : this.ordering) {
      OrderBy copyOrder = new OrderBy();
      copyOrder.setField(order.getField());
      copyOrder.setSortOrder(order.getSortOrder());
      orderingCopy.add(copyOrder);
    }
    return orderingCopy;
  }
View Full Code Here

   * Adds the order by the given field, on ASCENDING sort.
   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder orderAscBy(String field) {
    OrderBy order = new OrderBy();
    order.setField(field);
    order.setSortOrder(SortOrder.ASCENDING);

    this.ordering.add(order);

    return this;
  }
View Full Code Here

   * Adds the order by the given field, on DESCENDING sort.
   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder orderDescBy(String field) {
    OrderBy order = new OrderBy();
    order.setField(field);
    order.setSortOrder(SortOrder.DESCENDING);

    this.ordering.add(order);

    return this;
  }
View Full Code Here

   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder removeOrderBy(String field) {
    Iterator<OrderBy> iterator = this.ordering.iterator();
    while (iterator.hasNext()) {
      OrderBy order = iterator.next();
      if (order.getField().equals(field)) {
        iterator.remove();
      }
    }

    return this;
View Full Code Here

    Selector selector = builder.build();

    Assert.assertNotNull(selector.getOrdering());
    Assert.assertEquals(1, selector.getOrdering().size());

    OrderBy orderBy = selector.getOrdering().get(0);

    Assert.assertEquals("AverageCpm", orderBy.getField());
    Assert.assertEquals(SortOrder.ASCENDING, orderBy.getSortOrder());

    builder.orderDescBy("AverageCpc");
    selector = builder.build();

    Assert.assertNotNull(selector.getOrdering());
    Assert.assertEquals(2, selector.getOrdering().size());

    orderBy = selector.getOrdering().get(0);

    Assert.assertEquals("AverageCpm", orderBy.getField());
    Assert.assertEquals(SortOrder.ASCENDING, orderBy.getSortOrder());

    orderBy = selector.getOrdering().get(1);

    Assert.assertEquals("AverageCpc", orderBy.getField());
    Assert.assertEquals(SortOrder.DESCENDING, orderBy.getSortOrder());

    selector = builder.removeOrderBy("AverageCpm").build();

    Assert.assertNotNull(selector.getOrdering());
    Assert.assertEquals(1, selector.getOrdering().size());

    orderBy = selector.getOrdering().get(0);

    Assert.assertEquals("AverageCpc", orderBy.getField());
    Assert.assertEquals(SortOrder.DESCENDING, orderBy.getSortOrder());

  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.cm.ThirdPartyRedirectAd

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.