Examples of NetworkServiceInterface


Examples of com.google.api.ads.dfp.axis.v201208.NetworkServiceInterface

        .build();

    DfpServices dfpServices = new DfpServices();

    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

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

    runExample(dfpServices, session, parentId);
  }
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201211.NetworkServiceInterface

        .build();

    DfpServices dfpServices = new DfpServices();

    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

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

    runExample(dfpServices, session, parentId);
  }
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201302.NetworkServiceInterface

    // Get the ForecastService.
    ForecastServiceInterface forecastService =
        dfpServices.get(session, ForecastServiceInterface.class);

    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get the root ad unit ID used to target the whole site.
    String rootAdUnitId = networkService.getCurrentNetwork().getEffectiveRootAdUnitId();

    // Create inventory targeting.
    InventoryTargeting inventoryTargeting = new InventoryTargeting();

    // Create ad unit targeting for the root ad unit.
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201306.NetworkServiceInterface

    // Get the CustomTargetingService.
    CustomTargetingServiceInterface customTargetingService =
        dfpServices.get(session, CustomTargetingServiceInterface.class);

    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get content browse custom targeting key ID.
    long contentBrowseCustomTargetingKeyId =
        networkService.getCurrentNetwork().getContentBrowseCustomTargetingKeyId();

    if (contentBrowseCustomTargetingKeyId == 0) {
      throw new RuntimeException("Your network does not have content categories enabled.");     
    }
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201308.NetworkServiceInterface

*/
public class MakeTestNetwork {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Make the test network.
    Network network = networkService.makeTestNetwork();

    System.out.printf(
        "Test network with network code \"%s\" and display name \"%s\" created.\n"
        + "You may now sign in at https://www.google.com/dfp/main?networkCode=%s\n",
        network.getNetworkCode(), network.getDisplayName(), network.getNetworkCode());
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.NetworkServiceInterface

*/
public class GetAllNetworks {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get all networks that you have access to with the current authentication
    // credentials.
    Network[] networks = networkService.getAllNetworks();

    int i = 0;
    for (Network network : networks) {
      System.out.printf(
          "%d) Network with network code \"%s\" and display name \"%s\" was found.\n",
View Full Code Here

Examples of com.google.api.ads.dfp.axis.v201311.NetworkServiceInterface

*/
public class GetCurrentNetwork {

  public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
    // Get the NetworkService.
    NetworkServiceInterface networkService =
        dfpServices.get(session, NetworkServiceInterface.class);

    // Get the current network.
    Network network = networkService.getCurrentNetwork();

    System.out.printf("Current network has network code \"%s\" and display name \"%s\".\n",
        network.getNetworkCode(), network.getDisplayName());
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201208.NetworkServiceInterface

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

      // Get the NetworkService.
      NetworkServiceInterface networkService =
          user.getService(DfpService.V201208.NETWORK_SERVICE);

      // Get the effective root ad unit ID of the network.
      String effectiveRootAdUnitId = networkService.getCurrentNetwork().getEffectiveRootAdUnitId();

      // Create a statement to select the children of the effective root ad
      // unit.
      Statement filterStatement = new StatementBuilder("WHERE parentId = :id LIMIT 500")
          .putValue("id", effectiveRootAdUnitId).toStatement();
View Full Code Here

Examples of com.google.api.ads.dfp.v201208.NetworkServiceInterface

      // Get DfpUser from "~/dfp.properties". Comment out the networkCode field
      // to retrieve all networks you have access to.
      DfpUser user = new DfpUser();

      // Get the NetworkService.
      NetworkServiceInterface networkService = user.getService(DfpService.V201208.NETWORK_SERVICE);

      // Get all networks that you have access to with the current login
      // credentials.
      Network[] networks = networkService.getAllNetworks();

      int i = 0;
      for (Network network : networks) {
        System.out.println(i + ") Network with network code \"" + network.getNetworkCode()
            + "\" and display name \"" + network.getDisplayName() + "\" was found.");
View Full Code Here

Examples of com.google.api.ads.dfp.v201208.NetworkServiceInterface

      // Get the ContentService.
      ContentServiceInterface contentService = user.getService(DfpService.V201208.CONTENT_SERVICE);

      // Get the NetworkService.
      NetworkServiceInterface networkService = user.getService(DfpService.V201208.NETWORK_SERVICE);

      // Get the CustomTargetingService.
      CustomTargetingServiceInterface customTargetingService =
          user.getService(DfpService.V201208.CUSTOM_TARGETING_SERVICE);

      // Get content browse custom targeting key ID.
      long contentBrowseCustomTargetingKeyId =
          networkService.getCurrentNetwork().getContentBrowseCustomTargetingKeyId();

      // Create a statement to select the categories matching the name comedy.
      Statement categoryFilterStatement = new StatementBuilder(
          "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " +
          " and name = :category LIMIT 1")
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.