Package com.google.api.ads.dfp.v201308

Examples of com.google.api.ads.dfp.v201308.MobileDeviceTargeting


      deviceManufacturerTargeting
          .setDeviceManufacturers(new Technology[] {deviceManufacturerTechnology});
      technologyTargeting.setDeviceManufacturerTargeting(deviceManufacturerTargeting);

      // Create mobile device targeting.
      MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting();

      // Exclude the Nexus One device (604046).
      Technology mobileDeviceTechnology = new Technology();
      mobileDeviceTechnology.setId(604046L);
      mobileDeviceTargeting.setExcludedMobileDevices(new Technology[] {mobileDeviceTechnology});
      technologyTargeting.setMobileDeviceTargeting(mobileDeviceTargeting);

      // Create mobile device submodel targeting.
      MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting =
          new MobileDeviceSubmodelTargeting();
View Full Code Here


      deviceManufacturerTargeting
          .setDeviceManufacturers(new Technology[] {deviceManufacturerTechnology});
      technologyTargeting.setDeviceManufacturerTargeting(deviceManufacturerTargeting);

      // Create mobile device targeting.
      MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting();

      // Exclude the Nexus One device (604046).
      Technology mobileDeviceTechnology = new Technology();
      mobileDeviceTechnology.setId(604046L);
      mobileDeviceTargeting.setExcludedMobileDevices(new Technology[] {mobileDeviceTechnology});
      technologyTargeting.setMobileDeviceTargeting(mobileDeviceTargeting);

      // Create mobile device submodel targeting.
      MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting =
          new MobileDeviceSubmodelTargeting();
View Full Code Here

      deviceManufacturerTargeting
          .setDeviceManufacturers(new Technology[] {deviceManufacturerTechnology});
      technologyTargeting.setDeviceManufacturerTargeting(deviceManufacturerTargeting);

      // Create mobile device targeting.
      MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting();

      // Exclude the Nexus One device (604046).
      Technology mobileDeviceTechnology = new Technology();
      mobileDeviceTechnology.setId(604046L);
      mobileDeviceTargeting.setExcludedMobileDevices(new Technology[] {mobileDeviceTechnology});
      technologyTargeting.setMobileDeviceTargeting(mobileDeviceTargeting);

      // Create mobile device submodel targeting.
      MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting =
          new MobileDeviceSubmodelTargeting();
View Full Code Here

      deviceManufacturerTargeting
          .setDeviceManufacturers(new Technology[] {deviceManufacturerTechnology});
      technologyTargeting.setDeviceManufacturerTargeting(deviceManufacturerTargeting);

      // Create mobile device targeting.
      MobileDeviceTargeting mobileDeviceTargeting = new MobileDeviceTargeting();

      // Exclude the Nexus One device (604046).
      Technology mobileDeviceTechnology = new Technology();
      mobileDeviceTechnology.setId(604046L);
      mobileDeviceTargeting.setExcludedMobileDevices(new Technology[] {mobileDeviceTechnology});
      technologyTargeting.setMobileDeviceTargeting(mobileDeviceTargeting);

      // Create mobile device submodel targeting.
      MobileDeviceSubmodelTargeting mobileDeviceSubmodelTargeting =
          new MobileDeviceSubmodelTargeting();
View Full Code Here

      if (lineItemIds.size() > 0) {
        // Modify statement for action.
        filterStatement.setQuery("WHERE id IN (" + StringUtils.join(lineItemIds, ",") + ")");

        // Create action.
        ActivateLineItems action = new ActivateLineItems();

        // Perform action.
        UpdateResult result = lineItemService.performLineItemAction(action, filterStatement);

        // Display results.
View Full Code Here

      // Set the ID of the activity to update.
      Integer activityId = Integer.parseInt("INSERT_ACTIVITY_ID_HERE");

      // Get the activity.
      Activity activity = activityService.getActivity(activityId);

      // Update the expected URL.
      activity.setExpectedURL("http://google.com");

      // Update the activity on the server.
      Activity[] activities = activityService.updateActivities(new Activity[] {activity});

      for (Activity updatedActivity : activities) {
View Full Code Here

      // Set the ID of the activity group to create the activities for.
      Integer activityGroupId = Integer.parseInt("INSERT_ACTIVITY_GROUP_ID_HERE");

      // Create a daily visits activity.
      Activity dailyVisitsActivity = new Activity();
      dailyVisitsActivity.setName("Activity #" + new Random().nextLong());
      dailyVisitsActivity.setActivityGroupId(activityGroupId);
      dailyVisitsActivity.setType(ActivityType.DAILY_VISITS);

      // Create a custom activity.
      Activity customActivity = new Activity();
      customActivity.setName("Activity #" + new Random().nextLong());
      customActivity.setActivityGroupId(activityGroupId);
      customActivity.setType(ActivityType.CUSTOM);

      // Create the activities on the server.
      Activity[] activities =
          activityService.createActivities(new Activity[] {dailyVisitsActivity, customActivity});
View Full Code Here

      // Set the ID of the activity group and the company to update it with.
      Integer activityGroupId = Integer.parseInt("INSERT_ACTIVITY_GROUP_ID_HERE");
      Long advertiserCompanyId = Long.parseLong("INSERT_ADVERTISER_COMPANY_ID_HERE");

      // Get the activity group.
      ActivityGroup activityGroup = activityGroupService.getActivityGroup(activityGroupId);

      long[] companyIds = Arrays.copyOf(
          activityGroup.getCompanyIds(), activityGroup.getCompanyIds().length + 1);

      companyIds[companyIds.length - 1] = advertiserCompanyId;

      // Update the companies.
      activityGroup.setCompanyIds(companyIds);

      // Update the activity group on the server.
      ActivityGroup[] activityGroups =
          activityGroupService.updateActivityGroups(new ActivityGroup[] {activityGroup});
View Full Code Here

    // Get the ActivityGroupService.
    ActivityGroupServiceInterface activityGroupService =
        user.getService(DfpService.V201308.ACTIVITY_GROUP_SERVICE);

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

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

      // Get activity groups by statement.
      page = activityGroupService.getActivityGroupsByStatement(filterStatement);

      if (page.getResults() != null) {
        for (ActivityGroup activityGroup : page.getResults()) {
          activityGroupIds.add(activityGroup.getId());
        }
      }

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

    return activityGroupIds;
  }
View Full Code Here

  private static List<Integer> getAllActivityGroupIds(DfpUser user)
      throws RemoteException, ServiceException {
    List<Integer> activityGroupIds = new ArrayList<Integer>();

    // Get the ActivityGroupService.
    ActivityGroupServiceInterface activityGroupService =
        user.getService(DfpService.V201308.ACTIVITY_GROUP_SERVICE);

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

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

      // Get activity groups by statement.
      page = activityGroupService.getActivityGroupsByStatement(filterStatement);

      if (page.getResults() != null) {
        for (ActivityGroup activityGroup : page.getResults()) {
          activityGroupIds.add(activityGroup.getId());
        }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201308.MobileDeviceTargeting

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.