Package com.google.api.ads.adwords.axis.v201406.cm

Examples of com.google.api.ads.adwords.axis.v201406.cm.Address


        VideoCampaignStatus.ENABLED,
        VideoCampaignStatus.PAUSED
    });
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    VideoCampaignPage page;
    do {
      // Get all non-deleted video campaigns for this account.
      page = videoCampaignService.get(selector);

      // Display video campaigns.
      if (page.getEntries() != null) {
        for (VideoCampaign videoCampaign : page.getEntries()) {
          System.out.printf("Campaign id %d, name '%s' and status '%s' found.%n",
              videoCampaign.getId(),
              videoCampaign.getName(),
              videoCampaign.getStatus());
        }
      } else {
        System.out.println("No video campaigns were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
    } while (offset < page.getTotalNumEntries());
  }
View Full Code Here


    operation.setOperator(Operator.ADD);
   
    VideoCampaignOperation[] operations = new VideoCampaignOperation[] {operation};

    // Add video campaigns.
    VideoCampaignReturnValue result = videoCampaignService.mutate(operations);

    // Display video campaigns.
    for (VideoCampaign videoCampaignResult : result.getValue()) {
      System.out.printf("Campaign with name '%s' and id %d was added.%n",
          videoCampaignResult.getName(),
          videoCampaignResult.getId());
    }
  }
View Full Code Here

        new VideoEntityStatsSummaryType[] {VideoEntityStatsSummaryType.ALL});
    statsSelector.setSegmentedSummaryType(VideoEntityStatsSummaryType.ALL);

    int offset = 0;

    VideoCampaignSelector selector = new VideoCampaignSelector();
    selector.setStatsSelector(statsSelector);
    selector.setIds(new long[] {campaignId});
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    VideoCampaignPage page;
    do {
      // Get all campaigns.
      page = videoCampaignService.get(selector);

      // Display campaigns.
      if (page.getEntries() != null) {
        for (VideoCampaign videoCampaign : page.getEntries()) {
          System.out.printf("Campaign id %d, name '%s' and status '%s'%n",
              videoCampaign.getId(),
              videoCampaign.getName(),
              videoCampaign.getStatus());
          if (videoCampaign.getStats() != null) {
            System.out.println("\tCampaign stats:");
            System.out.println("\t\t" + format(videoCampaign.getStats()));
          }
          if (videoCampaign.getSegmentedStats() != null) {
            for (VideoEntityStats segment : videoCampaign.getSegmentedStats()) {
              System.out.println("\tCampaign segmented stats for month of "
                  + segment.getSegmentKey().getDateKey().getDate());
              System.out.println("\t\t" + format(segment));
            }
          }
        }
        if (page.getSummaryStats() != null) {
          for (VideoEntityStats summary : page.getSummaryStats()) {
            System.out.println("\tSummary of type "
                + summary.getSummaryType());
            System.out.println("\t\t" + format(summary));
          }
        }
      } else {
        System.out.println("No matching campaigns were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
    } while (offset < page.getTotalNumEntries());
  }
View Full Code Here

        adWordsServices.get(session, VideoCampaignServiceInterface.class);

    int offset = 0;

    // Create selector.
    VideoCampaignSelector selector = new VideoCampaignSelector();
    // Select non-deleted campaigns.
    selector.setCampaignStatuses(new VideoCampaignStatus[] {
        VideoCampaignStatus.ENABLED,
        VideoCampaignStatus.PAUSED
    });
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    VideoCampaignPage page;
    do {
      // Get all non-deleted video campaigns for this account.
      page = videoCampaignService.get(selector);

      // Display video campaigns.
      if (page.getEntries() != null) {
        for (VideoCampaign videoCampaign : page.getEntries()) {
          System.out.printf("Campaign id %d, name '%s' and status '%s' found.%n",
              videoCampaign.getId(),
              videoCampaign.getName(),
              videoCampaign.getStatus());
        }
      } else {
        System.out.println("No video campaigns were found.");
      }

      offset += PAGE_SIZE;
      selector.getPaging().setStartIndex(offset);
    } while (offset < page.getTotalNumEntries());
  }
View Full Code Here

    BudgetReturnValue budgetResult = budgetService.mutate(
        new BudgetOperation[] {budgetOperation});
    Long budgetId = budgetResult.getValue(0).getBudgetId();

    // Get the VideoCampaignService.
    VideoCampaignServiceInterface videoCampaignService =
        adWordsServices.get(session, VideoCampaignServiceInterface.class);

    // Create video campaign.
    VideoCampaign videoCampaign = new VideoCampaign();
    videoCampaign.setName("Interplanetary Cruise #"
        + System.currentTimeMillis());
    videoCampaign.setStatus(VideoCampaignStatus.PAUSED);
    VideoAdNetworks networks = new VideoAdNetworks();
    networks.setNetworks(new VideoAdNetwork[] {
        VideoAdNetwork.GOOGLE_DISPLAY_NETWORK,
        VideoAdNetwork.YOUTUBE_WATCH});
    videoCampaign.setNetworks(networks);

    // You can optionally provide these field(s).
    videoCampaign.setStartDate(new DateTime().plusDays(1).toString("yyyyMMdd"));
    videoCampaign.setBudgetId(budgetId);

    // Create operations.
    VideoCampaignOperation operation = new VideoCampaignOperation();
    operation.setOperand(videoCampaign);
    operation.setOperator(Operator.ADD);
   
    VideoCampaignOperation[] operations = new VideoCampaignOperation[] {operation};

    // Add video campaigns.
    VideoCampaignReturnValue result = videoCampaignService.mutate(operations);

    // Display video campaigns.
    for (VideoCampaign videoCampaignResult : result.getValue()) {
      System.out.printf("Campaign with name '%s' and id %d was added.%n",
          videoCampaignResult.getName(),
View Full Code Here

  }

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, Long campaignId) throws Exception {
    // Get the VideoCampaignService.
    VideoCampaignServiceInterface videoCampaignService =
        adWordsServices.get(session, VideoCampaignServiceInterface.class);

    // Set min date time to be January 1st of the current year.
    String minDateTime = new DateTime().toString("yyyy0101");
    // Set max date time to the current date.
    String maxDateTime = new DateTime().toString("yyyyMMdd");

    // Create selector.
    StatsSelector statsSelector = new StatsSelector();
    statsSelector.setDateRange(new DateRange(minDateTime, maxDateTime));
    statsSelector.setSegmentationDimensions(
        new SegmentationDimension[] {SegmentationDimension.DATE_MONTH});
    statsSelector.setMetrics(
        new Metric[] {Metric.VIEWS, Metric.COST, Metric.AVERAGE_CPV});
    statsSelector.setSummaryTypes(
        new VideoEntityStatsSummaryType[] {VideoEntityStatsSummaryType.ALL});
    statsSelector.setSegmentedSummaryType(VideoEntityStatsSummaryType.ALL);

    int offset = 0;

    VideoCampaignSelector selector = new VideoCampaignSelector();
    selector.setStatsSelector(statsSelector);
    selector.setIds(new long[] {campaignId});
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    VideoCampaignPage page;
    do {
      // Get all campaigns.
      page = videoCampaignService.get(selector);

      // Display campaigns.
      if (page.getEntries() != null) {
        for (VideoCampaign videoCampaign : page.getEntries()) {
          System.out.printf("Campaign id %d, name '%s' and status '%s'%n",
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session)
          throws Exception {
    // Get the VideoCampaignService.
    VideoCampaignServiceInterface videoCampaignService =
        adWordsServices.get(session, VideoCampaignServiceInterface.class);

    int offset = 0;

    // Create selector.
    VideoCampaignSelector selector = new VideoCampaignSelector();
    // Select non-deleted campaigns.
    selector.setCampaignStatuses(new VideoCampaignStatus[] {
        VideoCampaignStatus.ENABLED,
        VideoCampaignStatus.PAUSED
    });
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    VideoCampaignPage page;
    do {
      // Get all non-deleted video campaigns for this account.
      page = videoCampaignService.get(selector);

      // Display video campaigns.
      if (page.getEntries() != null) {
        for (VideoCampaign videoCampaign : page.getEntries()) {
          System.out.printf("Campaign id %d, name '%s' and status '%s' found.%n",
View Full Code Here

    operation.setOperator(Operator.SET);

    VideoCallToActionOperation[] operations = new VideoCallToActionOperation[] {operation};

    // Add video call to action.
    VideoReturnValue result = videoService.mutateCallToAction(operations);

    for (YouTubeVideo youTubeVideoResult : result.getValue()) {
      System.out.printf("CallToAction overlay was added to video ID %s, "
          + "headline '%s'.%n",
          youTubeVideoResult.getId(),
          youTubeVideoResult.getCallToAction().getCreative().getHeadline());
    }
View Full Code Here

    selector.setSearchType(VideoSearchSelectorSearchType.VIDEO);
    selector.setQuery(query);
    selector.setPaging(new Paging(0, PAGE_SIZE));

    // Run the query.
    VideoSearchPage page = videoService.search(selector);

    // Display videos.
    if (page.getTotalNumEntries() > 0) {
      for (YouTubeVideo video : page.getEntries()) {
        System.out.printf("YouTube video id %s with title '%s' found.%n",
            video.getId(),
            video.getTitle());
      }
      System.out.printf("Total number of matching videos: %d.%n",
          page.getTotalNumEntries());
    } else {
      System.out.printf("No videos matching '%s' were found.%n", query);
    }
  }
View Full Code Here

    // Get the VideoCampaignService.
    VideoServiceInterface videoService = adWordsServices.get(session, VideoServiceInterface.class);

    // Create a selector.
    VideoSearchSelector selector = new VideoSearchSelector();
    selector.setSearchType(VideoSearchSelectorSearchType.VIDEO);
    selector.setQuery(query);
    selector.setPaging(new Paging(0, PAGE_SIZE));

    // Run the query.
    VideoSearchPage page = videoService.search(selector);

    // Display videos.
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201406.cm.Address

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.