Package com.google.api.ads.dfa.axis.v1_20

Examples of com.google.api.ads.dfa.axis.v1_20.Placement


  public static void runExample(DfaServices dfaServices, DfaSession session) throws Exception {
    String username = session.getUsername();
    String password = session.getPassword();

    // Request the login service from the service client factory.
    LoginRemote loginService = dfaServices.get(session, LoginRemote.class);

    // Authenticate.
    UserProfile userProfile = loginService.authenticate(username, password);

    // Display user profile token, DFA account name and ID.
    System.out.printf("User profile token is \"%s\", DFA account name is \"%s\", and DFA " +
        "account ID is \"%s\".%n", userProfile.getToken(), userProfile.getNetworkName(),
        userProfile.getNetworkId());
View Full Code Here


    // Create an object filter to represent each object the user has access
    // to. Since this is an advertiser filter, an object filter represents an
    // advertiser. The total of object filter objects will need to match the
    // total of advertisers the user is assigned.
    ObjectFilter allowedObject = new ObjectFilter();
    // Insert the advertiser ID of an advertiser assigned to this user.
    allowedObject.setId(advertiserId);
    // Create any additional object filters that are needed, then create an
    // array of all of the object filters for this filter.
    ObjectFilter[] objectFilters = {allowedObject};
    // Add these settings to the user filter
    filterToAdd.setObjectFilters(objectFilters);
View Full Code Here

      long dfaSiteId, long campaignId, int pricingType, long sizeId) throws Exception {
    // Request the placement service from the service client factory.
    PlacementRemote placementService = dfaServices.get(session, PlacementRemote.class);

    // Create the placement.
    Placement placement = new Placement();
    placement.setId(0);
    placement.setName(placementName);
    placement.setCampaignId(campaignId);
    placement.setDfaSiteId(dfaSiteId);
    placement.setSizeId(sizeId);
    // The type ID for regular agency paid placements is 3. See
    // GetPlacementTypes.java
    placement.setPlacementType(3);

    // Set the pricing schedule for the placement.
    PricingSchedule pricingSchedule = new PricingSchedule();
    Calendar startDate = Calendar.getInstance();
    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.MONTH, 1);
    pricingSchedule.setStartDate(startDate);
    pricingSchedule.setEndDate(endDate);
    pricingSchedule.setPricingType(pricingType);
    placement.setPricingSchedule(pricingSchedule);

    // Set the placement tag settings.
    TagSettings tagSettings = new TagSettings();
    PlacementTagOption[] placementTagOptions = placementService.getRegularPlacementTagOptions();
    int[] tagTypes = new int[placementTagOptions.length];

    for (int i = 0; i < placementTagOptions.length; i++) {
      tagTypes[i] = (int) placementTagOptions[i].getId();
    }

    tagSettings.setTagTypes(tagTypes);
    placement.setTagSettings(tagSettings);

    // Save the placement.
    PlacementSaveResult placementSaveResult = placementService.savePlacement(placement);

    // Display the new placement ID.
View Full Code Here

    PlacementSearchCriteria searchCriteria = new PlacementSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get placement types.
    PlacementRecordSet placements = placementService.getPlacementsByCriteria(searchCriteria);

    // Display placment names and IDs.
    if (placements.getRecords() != null) {
      for (Placement result : placements.getRecords()) {
        System.out.printf("Placment with name \"%s\" and ID \"%s\" was found.%n",
            result.getName(), result.getId());
      }
    } else {
      System.out.println("No placements found for your criteria.");
View Full Code Here

  private static final String SEARCH_STRING = "INSERT_SEARCH_CRITERIA_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the placement service from the service client factory.
    PlacementRemote placementService = dfaServices.get(session, PlacementRemote.class);

    // Set placement search criteria.
    PlacementSearchCriteria searchCriteria = new PlacementSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get placement types.
    PlacementRecordSet placements = placementService.getPlacementsByCriteria(searchCriteria);

    // Display placment names and IDs.
    if (placements.getRecords() != null) {
      for (Placement result : placements.getRecords()) {
        System.out.printf("Placment with name \"%s\" and ID \"%s\" was found.%n",
View Full Code Here

  private static final String TOKEN = "INSERT_TOKEN_HERE";
  private static final String APPLICATION_NAME = "INSERT_APPLICATION_NAME_HERE";

  public static void runExample(DfaServices dfaServices, DfaSession session) throws Exception {
    // Request the placement service from the service client factory.
    PlacementRemote placementService = dfaServices.get(session, PlacementRemote.class);

    // Get placement types.
    PlacementType[] placements = placementService.getPlacementTypes();

    // Display placement type names and IDs.
    for (PlacementType result : placements) {
      System.out.printf("Placement type with name \"%s\" and ID \"%s\" was found.%n",
          result.getName(), result.getId());
View Full Code Here

*/
public class GetPlacementTypes {

  public static void runExample(DfaServices dfaServices, DfaSession session) throws Exception {
    // Request the service.
    PlacementRemote service = dfaServices.get(session, PlacementRemote.class);

    // Get placement types.
    PlacementType[] placements = service.getPlacementTypes();

    // Display placement type names and IDs.
    for (PlacementType result : placements) {
      System.out.println("Placement type with name \"" + result.getName()
          + "\" and ID \"" + result.getId() + "\" was found.");
View Full Code Here

      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the placement service from the service client factory.
    PlacementRemote placementService = dfaServices.get(session, PlacementRemote.class);

    // Set placement search criteria.
    PlacementSearchCriteria searchCriteria = new PlacementSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get placement types.
    PlacementRecordSet placements = placementService.getPlacementsByCriteria(searchCriteria);

    // Display placment names and IDs.
View Full Code Here

    // Create report request object.
    ReportRequest reportRequest = new ReportRequest();
    reportRequest.setQueryId(queryId);

    // Request generation of a report for your query.
    ReportInfo reportInfo = reportService.runDeferredReport(reportRequest);

    // Display success message.
    System.out.printf("Report with ID \"%s\" has been scheduled.%n", reportInfo.getReportId());
  }
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long queryId) throws Exception {

    // Request the report service from the service client factory.
    ReportRemote reportService = dfaServices.get(session, ReportRemote.class);

    // Create report request object.
    ReportRequest reportRequest = new ReportRequest();
    reportRequest.setQueryId(queryId);

    // Request generation of a report for your query.
    ReportInfo reportInfo = reportService.runDeferredReport(reportRequest);

    // Display success message.
    System.out.printf("Report with ID \"%s\" has been scheduled.%n", reportInfo.getReportId());
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfa.axis.v1_20.Placement

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.