Package com.google.api.ads.adwords.jaxws.v201309.cm

Examples of com.google.api.ads.adwords.jaxws.v201309.cm.Selector


          user.getService(AdWordsService.V201306.ADGROUP_AD_SERVICE);

      Long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "DisapprovalReasons"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Id", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate adGroupIdPredicate =
          new Predicate("AdGroupId", PredicateOperator.IN, new String[] {adGroupId.toString()});
      Predicate approvalStatusPredicate = new Predicate(
          "AdGroupCreativeApprovalStatus", PredicateOperator.IN, new String[] {"DISAPPROVED"});
      selector.setPredicates(new Predicate[] {adGroupIdPredicate, approvalStatusPredicate});

      // Get all disapproved ads.
      AdGroupAdPage page = adGroupAdService.get(selector);

      // Display ads.
View Full Code Here


   * @return A {@link SiteLinksFeed} if a feed is found, or {@code null} otherwise.
   * @throws Exception if an error occurs when retrieving an existing feed.
   */
  private static SiteLinksFeed getExistingFeed(FeedMappingServiceInterface feedMappingService)
      throws Exception {
    Selector selector = new Selector();
    selector.setFields(new String[] {"FeedId", "FeedMappingId", "PlaceholderType", "Status",
        "AttributeFieldMappings"});

    Predicate placeHolderPredicate = new Predicate();
    placeHolderPredicate.setField("PlaceholderType");
    placeHolderPredicate.setOperator(PredicateOperator.EQUALS);
    placeHolderPredicate.setValues(new String[] {Integer.toString(PLACEHOLDER_SITELINKS)});

    Predicate statusPredicate = new Predicate();
    statusPredicate.setField("Status");
    statusPredicate.setOperator(PredicateOperator.EQUALS);
    statusPredicate.setValues(new String[] {"ACTIVE"});

    selector.setPredicates(new Predicate[] {placeHolderPredicate, statusPredicate});

    FeedMappingPage page = feedMappingService.get(selector);

    if (page != null && page.getEntries() != null && page.getEntries().length > 0) {
      for (FeedMapping feedMapping : page.getEntries()) {
View Full Code Here

   */
  private static CampaignAdExtension getLegacySitelinksForCampaign(
      CampaignAdExtensionServiceInterface campaignExtensionService, long campaignId)
      throws Exception {
    // Create the selector.
    Selector selector = new Selector();
    selector.setFields(new String[] {"AdExtensionId", "DisplayText", "DestinationUrl"});

    // Filter the results for specified campaign id.
    Predicate campaignPredicate = new Predicate();
    campaignPredicate.setOperator(PredicateOperator.EQUALS);
    campaignPredicate.setField("CampaignId");
    campaignPredicate.setValues(new String[] {Long.toString(campaignId)});

    // Filter the results for active campaign ad extensions. You may add
    // additional filtering conditions here as required.
    Predicate statusPredicate = new Predicate();
    statusPredicate.setOperator(PredicateOperator.EQUALS);
    statusPredicate.setField("Status");
    statusPredicate.setValues(new String[] {CampaignAdExtensionStatus.ACTIVE.getValue()});

    // Filter for sitelinks ad extension type.
    Predicate typePredicate = new Predicate();
    typePredicate.setOperator(PredicateOperator.EQUALS);
    typePredicate.setField("AdExtensionType");
    typePredicate.setValues(new String[] {EXTENSION_NAME_FOR_SITELINKS});

    selector.setPredicates(new Predicate[] {campaignPredicate, statusPredicate, typePredicate});

    CampaignAdExtensionPage page = campaignExtensionService.get(selector);
    if (page.getEntries() != null && page.getEntries().length > 0) {
      return page.getEntries()[0];
    } else {
View Full Code Here

      // Get the CampaignService.
      CampaignServiceInterface campaignService =
          user.getService(AdWordsService.V201306.CAMPAIGN_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "Name", "Status"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate statusPredicate =
          new Predicate("Status", PredicateOperator.IN, new String[] {"PAUSED"});
      selector.setPredicates(new Predicate[] {statusPredicate});

      // Get all paused campaigns.
      CampaignPage page = campaignService.get(selector);

      // Display campaigns.
View Full Code Here

          user.getService(AdWordsService.V201306.ADGROUP_SERVICE);

      Long campaignId = Long.parseLong("INSERT_CAMPAIGN_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "Name"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate campaignIdPredicate =
          new Predicate("CampaignId", PredicateOperator.IN, new String[] {campaignId.toString()});
      selector.setPredicates(new Predicate[] {campaignIdPredicate});

      // Get all ad groups.
      AdGroupPage page = adGroupService.get(selector);

      // Display ad groups.
View Full Code Here

          user.getService(AdWordsService.V201306.EXPERIMENT_SERVICE);

      Long campaignId = Long.parseLong("INSET_CAMPAIGN_ID_HERE");

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Name", "Id", "ControlId", "AdGroupsCount",
          "AdGroupCriteriaCount", "AdGroupAdsCount"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});

      // Create predicates.
      Predicate campaignIdPredicate =
          new Predicate("CampaignId", PredicateOperator.IN, new String[] {campaignId.toString()});
      selector.setPredicates(new Predicate[] {campaignIdPredicate});

      // Get all experiments.
      ExperimentPage page = experimentService.get(selector);

      if (page.getEntries() != null) {
View Full Code Here

      CustomerSyncServiceInterface customerSyncService =
          user.getService(AdWordsService.V201306.CUSTOMER_SYNC_SERVICE);

      // Get a list of all campaign IDs.
      List<Long> campaignIds = new ArrayList<Long>();
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id"});
      CampaignPage campaigns = campaignService.get(selector);
      if (campaigns.getEntries() != null) {
        for (Campaign campaign : campaigns.getEntries()) {
          campaignIds.add(campaign.getId());
        }
View Full Code Here

          user.getService(AdWordsService.V201306.AD_PARAM_SERVICE);

      String adGroupId = "INSERT_AD_GROUP_ID_HERE";

      // Create selector.
      Selector selector = new Selector();
      Predicate predicate = new Predicate();
      predicate.setField("AdGroupId");
      predicate.setOperator(PredicateOperator.EQUALS);
      predicate.setValues(new String[] {adGroupId});
      selector.setPredicates(new Predicate[] {predicate});
      selector.setFields(new String[]{"AdGroupId", "CriterionId", "InsertionText", "ParamIndex"});

      // Get all ad parameters.
      AdParamPage page = adParamService.get(selector);

      // Display ad parameters.
View Full Code Here

      // Get the CampaignService.
      CampaignServiceInterface campaignService =
          user.getService(AdWordsService.V201306.CAMPAIGN_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Id", "Name"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});
     
      // Get all campaigns.
      CampaignPage page = campaignService.get(selector);

      // Display campaigns.
View Full Code Here

      // Get the ServicedAccountService.
      ManagedCustomerServiceInterface managedCustomerService =
          user.getService(AdWordsService.V201309.MANAGED_CUSTOMER_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Login", "CustomerId"});

      // Get results.
      ManagedCustomerPage page = managedCustomerService.get(selector);

      if (page.getEntries() != null) {
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.cm.Selector

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.