Package com.google.api.ads.dfp.v201302

Examples of com.google.api.ads.dfp.v201302.ActivityGroupServiceInterface


      CreativeServiceInterface creativeService =
          user.getService(DfpService.V201302.CREATIVE_SERVICE);

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

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

        // Get creatives by statement.
        page = creativeService.getCreativesByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here


      ThirdPartySlotServiceInterface thirdPartySlotService =
          user.getService(DfpService.V201302.THIRD_PARTY_SLOT_SERVICE);

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

      do {
        // Create a statement to get third party slots.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get third party slots by statement.
        page = thirdPartySlotService.getThirdPartySlotsByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

    InventoryServiceInterface inventoryService =
        user.getService(DfpService.V201302.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) {
View Full Code Here

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

    // 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) {
View Full Code Here

      ContactServiceInterface contactService =
          user.getService(DfpService.V201302.CONTACT_SERVICE);

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

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

        // Get contacts by statement.
        page = contactService.getContactsByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

          new UrlCreativeTemplateVariableValue();
      urlVariableValue.setUniqueName("ClickthroughURL");
      urlVariableValue.setValue("www.google.com");

      // Create the target window variable value.
      StringCreativeTemplateVariableValue targetWindowVariableValue =
          new StringCreativeTemplateVariableValue();
      targetWindowVariableValue.setUniqueName("Targetwindow");
      targetWindowVariableValue.setValue("__blank");

      templateCreative.setCreativeTemplateVariableValues(new BaseCreativeTemplateVariableValue[] {
          assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue,
          targetWindowVariableValue});
View Full Code Here

      // Create browser targeting.
      BrowserTargeting browserTargeting = new BrowserTargeting();
      browserTargeting.setIsTargeted(true);

      // Target just the Chrome browser.
      Technology browserTechnology = new Technology();
      browserTechnology.setId(500072L);
      browserTargeting.setBrowsers(new Technology[] {browserTechnology});
      technologyTargeting.setBrowserTargeting(browserTargeting);

      // Create targeting.
      Targeting targeting = new Targeting();
View Full Code Here

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

      // Create browser targeting.
      BrowserTargeting browserTargeting = new BrowserTargeting();
      browserTargeting.setIsTargeted(true);

      // Target just the Chrome browser.
      Technology browserTechnology = new Technology();
      browserTechnology.setId(500072L);
      browserTargeting.setBrowsers(new Technology[] {browserTechnology});
      technologyTargeting.setBrowserTargeting(browserTargeting);

      // Create targeting.
      Targeting targeting = new Targeting();
      targeting.setGeoTargeting(geoTargeting);
      targeting.setInventoryTargeting(inventoryTargeting);
View Full Code Here

      // Use the image banner with optional third party tracking template.
      Long creativeTemplateId = 10000680L;

      // Create the local custom creative object.
      TemplateCreative templateCreative = new TemplateCreative();
      templateCreative.setName("Template creative");
      templateCreative.setAdvertiserId(advertiserId);
      templateCreative.setCreativeTemplateId(creativeTemplateId);

      // Set the creative size.
      templateCreative.setSize(new Size(300, 250, false));

      // Create the asset variable value.
      AssetCreativeTemplateVariableValue assetVariableValue =
          new AssetCreativeTemplateVariableValue();
      assetVariableValue.setUniqueName("Imagefile");
      assetVariableValue.setAssetByteArray(MediaUtils.getAssetDataFromUrl(
          "http://www.google.com/intl/en/adwords/select/images/samples/inline.jpg"));
      // Filenames must be unique.
      assetVariableValue.setFileName(String.format("image%s.jpg", System.currentTimeMillis()));

      // Create the image width variable value.
      LongCreativeTemplateVariableValue imageWidthVariableValue =
          new LongCreativeTemplateVariableValue();
      imageWidthVariableValue.setUniqueName("Imagewidth");
      imageWidthVariableValue.setValue(300L);

      // Create the image height variable value.
      LongCreativeTemplateVariableValue imageHeightVariableValue =
          new LongCreativeTemplateVariableValue();
      imageHeightVariableValue.setUniqueName("Imageheight");
      imageHeightVariableValue.setValue(250L);

      // Create the URL variable value.
      UrlCreativeTemplateVariableValue urlVariableValue =
          new UrlCreativeTemplateVariableValue();
      urlVariableValue.setUniqueName("ClickthroughURL");
      urlVariableValue.setValue("www.google.com");

      // Create the target window variable value.
      StringCreativeTemplateVariableValue targetWindowVariableValue =
          new StringCreativeTemplateVariableValue();
      targetWindowVariableValue.setUniqueName("Targetwindow");
      targetWindowVariableValue.setValue("__blank");

      templateCreative.setCreativeTemplateVariableValues(new BaseCreativeTemplateVariableValue[] {
          assetVariableValue, imageWidthVariableValue, imageHeightVariableValue, urlVariableValue,
          targetWindowVariableValue});

      // Create the template creative on the server.
      templateCreative = (TemplateCreative) creativeService.createCreative(templateCreative);

      if (templateCreative != null) {
        System.out.println("A template creative with ID \"" + templateCreative.getId()
            + "\", name \"" + templateCreative.getName() + "\", and type \""
            + templateCreative.getCreativeType() + "\" was created and\n"
            + " can be previewed at: " + templateCreative.getPreviewUrl());
      } else {
        System.out.println("No creative was created.");
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

   */
  public static Value createValue(Object value) {
    if (value instanceof Value) {
      return (Value) value;
    } else if (value == null) {
      return new TextValue(null, null);
    } else {
      if (value instanceof Boolean) {
        return new BooleanValue(null, (Boolean) value);
      } else if (value instanceof Double) {
        return new NumberValue(null, value.toString());
      } else if (value instanceof String) {
        return new TextValue(null, (String) value);
      } else if (value instanceof Long) {
        return new NumberValue(null, value.toString());
      } else if (value instanceof DateTime) {
        return new DateTimeValue(null, (DateTime) value);
      } else {
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201302.ActivityGroupServiceInterface

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.