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

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


    // Request the service.
    CreativeFieldRemote service = dfaServices.get(session, CreativeFieldRemote.class);

    // Set up creative field value search criteria structure.
    CreativeFieldValueSearchCriteria creativeValueSearchCriteria =
        new CreativeFieldValueSearchCriteria();
    creativeValueSearchCriteria.setPageSize(10);
    creativeValueSearchCriteria.setSearchString(searchString);

    // Get creative field values for the selected criteria.
    CreativeFieldValueRecordSet creativeFieldValues =
        service.getCreativeFieldValues(creativeValueSearchCriteria);
View Full Code Here


    CreativeGroupSearchCriteria creativeGroupSearchCriteria = new CreativeGroupSearchCriteria();
    long[] advertiserIds = new long[] {advertiserId};
    creativeGroupSearchCriteria.setAdvertiserIds(advertiserIds);

    // Get creatives groups for the selected criteria.
    CreativeGroupRecordSet creativeGroups =
        service.getCreativeGroups(creativeGroupSearchCriteria);

    // Display creative group names, IDs, advertiser IDs, and group numbers.
    if (creativeGroups.getRecords() != null) {
      for (CreativeGroup result : creativeGroups.getRecords()){
        System.out.println("Creative group with name \"" + result.getName()
            + "\" , ID \"" + result.getId()
            + "\", advertiser ID \"" + result.getAdvertiserId()
            + "\", and group number \"" + result.getGroupNumber()
            + "\" was found.");
View Full Code Here

    // Create creative placement assignment structure.
    CreativePlacementAssignment[] creativePlacementAssignment =
        new CreativePlacementAssignment[creativeIds.length];

    for (int i = 0; i < creativeIds.length; i++){
      creativePlacementAssignment[i] = new CreativePlacementAssignment();
      creativePlacementAssignment[i].setCreativeId(creativeIds[i]);
      creativePlacementAssignment[i].setPlacementId(placementIds[0]);
      creativePlacementAssignment[i].setPlacementIds(placementIds);
    }
View Full Code Here

    creativeSearchCriteria.setPageSize(100);
    creativeSearchCriteria.setAdvertiserId(advertiserId);
    // When paging, start counting page numbers from 1 rather than 0.
    creativeSearchCriteria.setPageNumber(1);

    CreativeRecordSet creatives;
    int i = 1;

    do {
      // Get creatives for the selected criteria.
      creatives = creativeService.getCreatives(creativeSearchCriteria);

      for (CreativeBase result : creatives.getRecords()) {
        System.out.printf("%s) Creative with name \"%s\" and ID \"%s\" was found.%n",
            i++, result.getName(), result.getId());
      }

      creativeSearchCriteria.setPageNumber(creativeSearchCriteria.getPageNumber() + 1);
    } while (creativeSearchCriteria.getPageNumber() <= creatives.getTotalNumberOfPages());

    System.out.printf("Number of results found: %s%n",
        creatives.getTotalNumberOfRecords());
  }
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, long[] creativeIds, long[] placementIds)
          throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create creative placement assignment structure.
    CreativePlacementAssignment[] creativePlacementAssignment =
        new CreativePlacementAssignment[creativeIds.length];

    for (int i = 0; i < creativeIds.length; i++){
      creativePlacementAssignment[i] = new CreativePlacementAssignment();
      creativePlacementAssignment[i].setCreativeId(creativeIds[i]);
      creativePlacementAssignment[i].setPlacementId(placementIds[0]);
      creativePlacementAssignment[i].setPlacementIds(placementIds);
    }

    // Assign creatives to placements.
    CreativePlacementAssignmentResult[] creativeAssigmentResult =
      creativeService.assignCreativesToPlacements(creativePlacementAssignment);

    // Display new ads that resulted from the assignment.
    for (CreativePlacementAssignmentResult result : creativeAssigmentResult) {
      System.out.printf("Ad with name \"%s\" and ID \"%s\" was created.%n",
          result.getAdName(), result.getAdId());
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String creativeName, String mobileAssetFileName,
      long advertiserId, long campaignId) throws Exception {
    // Request the service.
    CreativeRemote service = dfaServices.get(session, CreativeRemote.class);

    // Create the mobile display creative.
    MobileDisplayCreative mobileDisplayCreative = new MobileDisplayCreative();
    mobileDisplayCreative.setAdvertiserId(advertiserId);
    mobileDisplayCreative.setName(creativeName);
    mobileDisplayCreative.setArchived(false);
    // The type ID for mobile creatives is 30. See GetCreativeTypes.java
    mobileDisplayCreative.setTypeId(30);

    // Set the mobile creative asset.
    HTMLCreativeAsset htmlCreativeAsset = new MobileDisplayCreativeAsset();
    htmlCreativeAsset.setAssetFilename(mobileAssetFileName);
    mobileDisplayCreative.setCreativeAssets(new HTMLCreativeAsset[]{htmlCreativeAsset});

    // Save the mobile display creative.
    CreativeSaveResult creativeSaveResult = service.saveCreative(mobileDisplayCreative,
        campaignId);

    // Display the new creative ID.
    System.out.printf("Mobile display creative with ID \"%s\" was created.%n",
        creativeSaveResult.getId());
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String assetName, String pathToFile,
      long advertiserId) throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create the image asset.
    CreativeAsset imgAsset = new CreativeAsset();
    imgAsset.setForHTMLCreatives(false);
    imgAsset.setName(assetName);
    imgAsset.setContent(Media.getMediaDataFromFile(pathToFile));
    imgAsset.setAdvertiserId(advertiserId);

    // Save the image asset.
    CreativeAssetSaveResult creativeAssetSaveResult = creativeService.saveCreativeAsset(
        imgAsset);

    // Display the new asset file name.
    System.out.printf("Asset was saved with file name of \"%s\".%n",
        creativeAssetSaveResult.getSavedFilename());
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String assetName, String pathToFile,
      long creativeId, String assetToReplace) throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create the In-Stream creative asset.
    CreativeAsset inStreamVideoAsset = new CreativeAsset();
    inStreamVideoAsset.setName(assetName);
    inStreamVideoAsset.setContent(Media.getMediaDataFromFile(pathToFile));

    // Create an upload request to make this asset a companion ad file for an
    // existing In-Stream video creative.
    InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest();
    inStreamAssetUploadRequest.setCompanion(true);
    inStreamAssetUploadRequest.setInStreamAsset(inStreamVideoAsset);
    inStreamAssetUploadRequest.setCreativeId(creativeId);

    // Replace the existing asset with a newly uploaded asset.
    InStreamVideoCreative inStreamVideoCreative =
        creativeService.replaceInStreamAsset(assetToReplace, inStreamAssetUploadRequest);

    // Display a success message.
    System.out.printf("Replaced companion ad asset \"%s\" in In-Stream video creative "
        + "with ID \"%s\".%n", assetToReplace, inStreamVideoCreative.getId());
  }
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String assetName, String pathToFile,
      long creativeId) throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create the In-Stream video creative asset.
    CreativeAsset inStreamVideoAsset = new CreativeAsset();
    inStreamVideoAsset.setName(assetName);
    inStreamVideoAsset.setContent(Media.getMediaDataFromFile(pathToFile));

    // Create an upload request to make this asset a media file for an existing
    // In-Stream creative.
    InStreamAssetUploadRequest inStreamAssetUploadRequest = new InStreamAssetUploadRequest();
    inStreamAssetUploadRequest.setMediaFile(true);
    inStreamAssetUploadRequest.setInStreamAsset(inStreamVideoAsset);
    inStreamAssetUploadRequest.setCreativeId(creativeId);

    // Save the media file.
    InStreamVideoCreative inStreamVideoCreative =
        creativeService.uploadInStreamAsset(inStreamAssetUploadRequest);

    // Display a success message.
    System.out.printf("Added a media file to In-Stream video creative with ID \"%s\".%n",
        inStreamVideoCreative.getId());
  }
View Full Code Here

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String assetName, String pathToFile,
      long advertiserId) throws Exception {
    // Request the service.
    CreativeRemote service = dfaServices.get(session, CreativeRemote.class);

    // Create the HTML asset.
    CreativeAsset swfAsset = new CreativeAsset();
    swfAsset.setForHTMLCreatives(true);
    swfAsset.setName(assetName);
    swfAsset.setContent(Media.getMediaDataFromFile(pathToFile));
    swfAsset.setAdvertiserId(advertiserId);

    // Save the asset.
    CreativeAssetSaveResult creativeAssetSaveResult = service.saveCreativeAsset(swfAsset);

    // Display the new asset file name.
    System.out.printf("Asset was saved with file name of \"%s\".%n",
        creativeAssetSaveResult.getSavedFilename());
  }
View Full Code Here

TOP

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

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.