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

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


    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


    if (!(rawCreative instanceof InStreamVideoCreative)) {
      System.out.printf("Unable to update creative with ID \"%s\": not an In-Stream video "
          + "creative.", creativeId);
    } else {
      InStreamVideoCreative inStreamVideoCreative = (InStreamVideoCreative) rawCreative;

      // Modify the media files, companion ads, and/or non-linear ads.
      if (inStreamVideoCreative.getMediaFiles() != null) {
        for (InStreamMediaFile mediaFile : inStreamVideoCreative.getMediaFiles()) {
          mediaFile.setPickedToServe(!mediaFile.isPickedToServe());
        }
      }

      if (inStreamVideoCreative.getCompanionAds() != null) {
        for (InStreamCompanionAd companionAd : inStreamVideoCreative.getCompanionAds()) {
          companionAd.setAltText(companionAd.getAltText() + " Updated.");
        }
      }

      if (inStreamVideoCreative.getNonLinearAds() != null) {
        for (InStreamNonLinearAd nonLinearAd : inStreamVideoCreative.getNonLinearAds()) {
          nonLinearAd.setScalable(!nonLinearAd.isScalable());
        }
      }

      CreativeSaveResult creativeSaveResult =
View Full Code Here

    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

    campaign.setId(0);
    campaign.setName(campaignName);
    campaign.setAdvertiserId(advertiserId);

    // Create and set a default landing page.
    LandingPage defaultLandingPage = new LandingPage();
    defaultLandingPage.setId(0);
    defaultLandingPage.setName(landingPageName);
    defaultLandingPage.setUrl(url);
    campaign.setDefaultLandingPageId(campaignService.saveLandingPage(
        defaultLandingPage).getId());

    // Set the campaign start date. This example uses today's date.
    Calendar startDate = Calendar.getInstance();
View Full Code Here

  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

    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

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.