Package com.google.api.ads.dfp.v201211

Examples of com.google.api.ads.dfp.v201211.TimeOfDay


    dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

    // Target only the weekend in the browser's timezone.
    DayPart saturdayDayPart = new DayPart();
    saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
    saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

    DayPart sundayDayPart = new DayPart();
    sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
    sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
    dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

    // Create technology targeting.
    TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here


    dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

    // Target only the weekend in the browser's timezone.
    DayPart saturdayDayPart = new DayPart();
    saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
    saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

    DayPart sundayDayPart = new DayPart();
    sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
    sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
    dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

    // Create technology targeting.
    TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here

    dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

    // Target only the weekend in the browser's timezone.
    DayPart saturdayDayPart = new DayPart();
    saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
    saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

    DayPart sundayDayPart = new DayPart();
    sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
    sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
    dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

    // Create technology targeting.
    TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here

    dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

    // Target only the weekend in the browser's timezone.
    DayPart saturdayDayPart = new DayPart();
    saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
    saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

    DayPart sundayDayPart = new DayPart();
    sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
    sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
    sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
    dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

    // Create technology targeting.
    TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here

      dayPartTargeting.setTimeZone(DeliveryTimeZone.BROWSER);

      // Target only the weekend in the browser's timezone.
      DayPart saturdayDayPart = new DayPart();
      saturdayDayPart.setDayOfWeek(DayOfWeek.SATURDAY);
      saturdayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
      saturdayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));

      DayPart sundayDayPart = new DayPart();
      sundayDayPart.setDayOfWeek(DayOfWeek.SUNDAY);
      sundayDayPart.setStartTime(new TimeOfDay(0, MinuteOfHour.ZERO));
      sundayDayPart.setEndTime(new TimeOfDay(24, MinuteOfHour.ZERO));
      dayPartTargeting.setDayParts(new DayPart[] {saturdayDayPart, sundayDayPart});

      // Create technology targeting.
      TechnologyTargeting technologyTargeting = new TechnologyTargeting();
View Full Code Here

      // Set the parent ad unit's ID for all ad units to be created under.
      String effectiveRootAdUnitId = networkService.getCurrentNetwork().getEffectiveRootAdUnitId();

      // Create local ad unit object.
      AdUnit adUnit = new AdUnit();
      adUnit.setName("Video_Ad_Unit");
      adUnit.setParentId(effectiveRootAdUnitId);
      adUnit.setDescription("Ad unit description.");
      adUnit.setTargetWindow(AdUnitTargetWindow.BLANK);
      adUnit.setExplicitlyTargeted(true);
      adUnit.setTargetPlatform(TargetPlatform.WEB);

      // Create master ad unit size.
      AdUnitSize masterAdUnitSize = new AdUnitSize();
      masterAdUnitSize.setSize(new Size(400, 300, false));
      masterAdUnitSize.setEnvironmentType(EnvironmentType.VIDEO_PLAYER);

      // Create companion sizes.
      AdUnitSize companionAdUnitSize1 = new AdUnitSize();
      companionAdUnitSize1.setSize(new Size(300, 250, false));
      companionAdUnitSize1.setEnvironmentType(EnvironmentType.BROWSER);

      AdUnitSize companionAdUnitSize2 = new AdUnitSize();
      companionAdUnitSize2.setSize(new Size(728, 90, false));
      companionAdUnitSize2.setEnvironmentType(EnvironmentType.BROWSER);

      // Add companions to master ad unit size.
      masterAdUnitSize.setCompanions(new AdUnitSize[] {companionAdUnitSize1, companionAdUnitSize2});

      // Set the size of possible creatives that can match this ad unit.
      adUnit.setAdUnitSizes(new AdUnitSize[] {masterAdUnitSize});

      // Create the ad unit on the server.
      adUnit = inventoryService.createAdUnit(adUnit);

      if (adUnit != null) {
        System.out.println("An ad unit with ID \"" + adUnit.getId()
            + "\" was created under parent with ID \"" + adUnit.getParentId()
            + "\".");
      } else {
        System.out.println("No ad units created.");
      }
    } catch (Exception e) {
View Full Code Here

      // Set the ID of the ad unit to get.
      String adUnitId = "INSERT_AD_UNIT_ID_HERE";

      // Get the ad unit.
      AdUnit adUnit = inventoryService.getAdUnit(adUnitId);

      if (adUnit != null) {
        System.out.println("Ad unit with ID \"" + adUnit.getId()
            + "\", name \"" + adUnit.getName()
            + "\", and status \"" + adUnit.getStatus() + "\" was found.");
      } else {
        System.out.println("No ad unit found for this ID.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

      // Find the root ad unit. rootAdUnit can also be set to child unit to
      // only build and display a portion of the tree.
      // i.e. AdUnit adUnit =
      //          inventoryService.getAdUnit("INSERT_AD_UNIT_HERE")
      AdUnit rootAdUnit = findRootAdUnit(user);

      if (rootAdUnit == null) {
        System.out.println("Could not build tree. No root ad unit found.");
      } else {
        buildAndDisplayAdUnitTree(rootAdUnit, allAdUnits);
View Full Code Here

    // Get InventoryService.
    InventoryServiceInterface inventoryService =
        user.getService(DfpService.V201211.INVENTORY_SERVICE);

    // Sets defaults for page and filterStatement.
    AdUnitPage page = new AdUnitPage();
    Statement filterStatement = new Statement();
    int offset = 0;

    do {
      // Create a statement to get all ad units.
      filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

      // Get ad units by statement.
      page = inventoryService.getAdUnitsByStatement(filterStatement);

      if (page.getResults() != null) {
        adUnits.addAll(Arrays.asList(page.getResults()));
      }

      offset += 500;
    } while (offset < page.getTotalResultSetSize());

    return adUnits.toArray(new AdUnit[] {});
  }
View Full Code Here

    // Create a statement to only select the root ad unit.
    Statement filterStatement = new Statement("WHERE parentId IS NULL LIMIT 500", null);

    // Get ad units by statement.
    AdUnitPage page = inventoryService.getAdUnitsByStatement(filterStatement);

    if (page.getResults() != null) {
      return page.getResults()[0];
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201211.TimeOfDay

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.