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

Examples of com.google.api.ads.dfa.axis.v1_19.UserProfile


    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 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

  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

*/
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

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

      long campaignId, long sizeId, long creativeId, long placementId) throws Exception {
    // Request the service.
    AdRemote service = dfaServices.get(session, AdRemote.class);

    // Create a rotation group.
    RotationGroup rotationGroup = new RotationGroup();
    rotationGroup.setId(0);
    rotationGroup.setName(adName);
    rotationGroup.setActive(true);
    rotationGroup.setArchived(false);
    rotationGroup.setCampaignId(campaignId);
    rotationGroup.setSizeId(sizeId);
    rotationGroup.setTypeId(1);
    rotationGroup.setPriority(12);
    rotationGroup.setRatio(1);

    // Set the ad start date. This example uses tomorrow's date.
    Calendar startTime = Calendar.getInstance();
    startTime.add(Calendar.DATE, 1);
    rotationGroup.setStartTime(startTime);

    // Set the ad end date. This example uses one month from today's date.
    Calendar endTime = Calendar.getInstance();
    endTime.add(Calendar.MONTH, 1);
    rotationGroup.setEndTime(endTime);

    // Add creatives to the ad.
    CreativeAssignment creativeAssignment = new CreativeAssignment();
    creativeAssignment.setActive(true);
    creativeAssignment.setCreativeId(creativeId);

    // Create the click through URL.
    ClickThroughUrl clickThroughUrl = new ClickThroughUrl();
    clickThroughUrl.setDefaultLandingPageUsed(true);
    clickThroughUrl.setLandingPageId(0);
    creativeAssignment.setClickThroughUrl(clickThroughUrl);

    // Create the creative assignments.
    CreativeAssignment[] creativeAssignments = new CreativeAssignment[]{creativeAssignment};
    rotationGroup.setCreativeAssignments(creativeAssignments);
    rotationGroup.setRotationType(1);

    // Assign an ad to the placement.
    PlacementAssignment placementAssignment = new PlacementAssignment();
    placementAssignment.setActive(true);
    placementAssignment.setPlacementId(placementId);
    PlacementAssignment[] placementAssignments = new PlacementAssignment[]{placementAssignment};
    rotationGroup.setPlacementAssignments(placementAssignments);

    // Save the rotation group.
    AdSaveResult adSaveResult = service.saveAd(rotationGroup);

    // Display the new ad ID.
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 service.
    SiteRemote service = dfaServices.get(session, SiteRemote.class);

    // Create DFA site search criteria structure.
    DfaSiteSearchCriteria searchCriteria = new DfaSiteSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get the sites.
    DfaSiteRecordSet dfaSiteRecordSet = service.getDfaSites(searchCriteria);

    // Display DFA site names and IDs.
    if (dfaSiteRecordSet.getRecords() != null) {
      for (DfaSite result : dfaSiteRecordSet.getRecords()) {
        System.out.println("DFA site with name \"" + result.getName()
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfa.axis.v1_19.UserProfile

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.