Examples of CampaignRemote


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

  private static final String APPLICATION_NAME = "INSERT_APPLICATION_NAME_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the campaign service from the service client factory.
    CampaignRemote campaignService = dfaServices.get(session, CampaignRemote.class);

    // Create campaign search criteria structure.
    CampaignSearchCriteria searchCriteria = new CampaignSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get the campaigns.
    CampaignRecordSet campaignRecordSet = campaignService.getCampaignsByCriteria(searchCriteria);

    // Display campaign names and IDs.
    if (campaignRecordSet.getRecords().length > 0) {
      for (Campaign result : campaignRecordSet.getRecords()) {
        System.out.printf("Campaign with name \"%s\" and ID \"%s\" was found.%n",
View Full Code Here

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

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String campaignName, long advertiserId,
      String url, String landingPageName) throws Exception {
    // Request the campaign service from the service client factory.
    CampaignRemote campaignService = dfaServices.get(session, CampaignRemote.class);

    // Create the campaign structure.
    Campaign campaign = new Campaign();
    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();
    campaign.setStartDate(startDate);

    // Set the campaign end date. This example uses one month from today's date.
    Calendar endDate = Calendar.getInstance();
    endDate.add(Calendar.MONTH, 1);
    campaign.setEndDate(endDate);

    // Save the campaign.
    CampaignSaveResult campaignSaveResult = campaignService.saveCampaign(campaign);

    // Display the new campaign ID.
    System.out.printf("Campaign with ID \"%s\" was created.%n", campaignSaveResult.getId());
  }
View Full Code Here

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

  private static final String APPLICATION_NAME = "INSERT_APPLICATION_NAME_HERE";

  public static void runExample(
      DfaServices dfaServices, DfaSession session, String searchString) throws Exception {
    // Request the campaign service from the service client factory.
    CampaignRemote campaignService = dfaServices.get(session, CampaignRemote.class);

    // Create campaign search criteria structure.
    CampaignSearchCriteria searchCriteria = new CampaignSearchCriteria();
    searchCriteria.setPageSize(10);
    searchCriteria.setSearchString(searchString);

    // Get the campaigns.
    CampaignRecordSet campaignRecordSet = campaignService.getCampaignsByCriteria(searchCriteria);

    // Display campaign names and IDs.
    if (campaignRecordSet.getRecords().length > 0) {
      for (Campaign result : campaignRecordSet.getRecords()) {
        System.out.printf("Campaign with name \"%s\" and ID \"%s\" was found.%n",
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.