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

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


  public static void runExample(
      DfaServices dfaServices, DfaSession session, String creativeName, String assetFileName,
      long advertiserId, long sizeId, long campaignId) throws Exception {

    // 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);

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


*/
public class GetCreativeTypes {

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

    // Get creative types.
    CreativeType[] creativeTypes = service.getCreativeTypes();

    // Display creative types and IDs.
    for (CreativeType result : creativeTypes){
      System.out.println("Creative type name \"" + result.getName()
          + "\" with ID \"" + result.getId() + "\" was found.");
View Full Code Here

  private static final String ADVERTISER_ID = "INSERT_ADVERTISER_ID_HERE";

  public static void runExample(DfaServices dfaServices, DfaSession session, long advertiserId)
      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());
      }
View Full Code Here

    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

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

    // Display the new creative ID.
    System.out.printf("Image 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

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

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.