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

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


    TargetWindow backupImageTargetWindow = new TargetWindow();
    backupImageTargetWindow.setOption("_blank");
    flashInpage.setBackupImageTargetWindow(backupImageTargetWindow);

    // Save the Flash in-page creative.
    CreativeSaveResult creativeSaveResult = service.saveCreative(flashInpage, campaignId);

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


      throws Exception {
    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Set up creative search criteria structure.
    CreativeSearchCriteria creativeSearchCriteria = new CreativeSearchCriteria();
    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

    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()
            + "\" and ID \"" + result.getId() + "\" was found.");
      }
    } else {
      System.out.print("No DFA sites found for your search criteria.");
View Full Code Here

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

      String imgAssetFileName, long advertiserId, long sizeId, long campaignId) throws Exception {
    // Request the service.
    CreativeRemote service = dfaServices.get(session, CreativeRemote.class);

    // Create the Flash in-page creative.
    FlashInpageCreative flashInpage = new FlashInpageCreative();
    flashInpage.setId(0);
    flashInpage.setName(creativeName);
    flashInpage.setAdvertiserId(advertiserId);
    flashInpage.setActive(true);
    flashInpage.setCodeLocked(true);
    flashInpage.setSizeId(sizeId);
    // The type ID for FlashInpageCreative is 24. See GetCreativeTypes.java
    flashInpage.setTypeId(24);

    // Set the parent flash asset structure.
    HTMLCreativeFlashAsset parentFlashAsset = new HTMLCreativeFlashAsset();
    parentFlashAsset.setAssetFilename(swfAssetFileName);
    flashInpage.setParentFlashAsset(parentFlashAsset);
    flashInpage.setWmode("opaque");

    // Set the backup image asset.
    HTMLCreativeAsset backupImageAsset = new HTMLCreativeAsset();
    backupImageAsset.setAssetFilename(imgAssetFileName);
    flashInpage.setBackupImageAsset(backupImageAsset);

    // Set the target window for backup image.
    TargetWindow backupImageTargetWindow = new TargetWindow();
    backupImageTargetWindow.setOption("_blank");
    flashInpage.setBackupImageTargetWindow(backupImageTargetWindow);

    // Save the Flash in-page creative.
    CreativeSaveResult creativeSaveResult = service.saveCreative(flashInpage, campaignId);

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

    parentFlashAsset.setAssetFilename(swfAssetFileName);
    flashInpage.setParentFlashAsset(parentFlashAsset);
    flashInpage.setWmode("opaque");

    // Set the backup image asset.
    HTMLCreativeAsset backupImageAsset = new HTMLCreativeAsset();
    backupImageAsset.setAssetFilename(imgAssetFileName);
    flashInpage.setBackupImageAsset(backupImageAsset);

    // Set the target window for backup image.
    TargetWindow backupImageTargetWindow = new TargetWindow();
    backupImageTargetWindow.setOption("_blank");
View Full Code Here

    flashInpage.setSizeId(sizeId);
    // The type ID for FlashInpageCreative is 24. See GetCreativeTypes.java
    flashInpage.setTypeId(24);

    // Set the parent flash asset structure.
    HTMLCreativeFlashAsset parentFlashAsset = new HTMLCreativeFlashAsset();
    parentFlashAsset.setAssetFilename(swfAssetFileName);
    flashInpage.setParentFlashAsset(parentFlashAsset);
    flashInpage.setWmode("opaque");

    // Set the backup image asset.
    HTMLCreativeAsset backupImageAsset = new HTMLCreativeAsset();
View Full Code Here

    // Request the creative service from the service client factory.
    CreativeRemote creativeService = dfaServices.get(session, CreativeRemote.class);

    // Create the image creative.
    ImageCreative imageCreative = new ImageCreative();
    imageCreative.setId(0);
    imageCreative.setName(creativeName);
    imageCreative.setActive(true);
    imageCreative.setAdvertiserId(advertiserId);
    imageCreative.setSizeId(sizeId);
    imageCreative.setAssetFilename(assetFileName);
    // The type ID for image creatives is 1. See GetCreativeTypes.java
    imageCreative.setTypeId(1);

    // Save the image creative.
    CreativeSaveResult creativeSaveResult = creativeService.saveCreative(imageCreative,
        campaignId);
View Full Code Here

    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);
View Full Code Here

    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);
View Full Code Here

TOP

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

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.