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

Examples of com.google.api.ads.dfp.jaxws.v201211.PlacementServiceInterface


      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the PlacementService.
      PlacementServiceInterface placementService =
          user.getService(DfpService.V201311.PLACEMENT_SERVICE);

      // Create a statement to select first 500 placements.
      Statement filterStatement = new Statement("LIMIT 500", null);

      // Get placements by statement.
      PlacementPage page = placementService.getPlacementsByStatement(filterStatement);

      if (page.getResults() != null) {
        Placement[] placements = page.getResults();

        // Update each local placement object by enabling AdSense targeting.
        for (Placement placement : placements) {
          placement.setTargetingDescription(
              (placement.getDescription() == null || placement.getDescription().isEmpty())
              ? "Generic description" : placement.getDescription());
          placement.setTargetingAdLocation("All images on sports pages.");
          placement.setTargetingSiteName("http://code.google.com");
          placement.setIsAdSenseTargetingEnabled(true);
        }

        // Update the placements on the server.
        placements = placementService.updatePlacements(placements);

        // Display results.
        if (placements != null) {
          for (Placement placement : placements) {
            System.out.println("A placement with ID \""
View Full Code Here


      // Get DfpUser from "~/dfp.properties".
      DfpUser user = new DfpUser();

      // Get the PlacementService.
      PlacementServiceInterface placementService =
          user.getService(DfpService.V201311.PLACEMENT_SERVICE);

      // Set the ID of the placement to get.
      Long placementId = Long.parseLong("INSERT_PLACEMENT_ID_HERE");

      // Get the placement.
      Placement placement = placementService.getPlacement(placementId);

      if (placement != null) {
        System.out.println("Placement with ID \"" + placement.getId()
            + "\", name \"" + placement.getName()
            + "\", and status \"" + placement.getStatus() + "\" was found.");
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.jaxws.v201211.PlacementServiceInterface

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.