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

Examples of com.google.api.ads.adwords.axis.v201406.video.VideoTargetingGroupCriterionServiceInterface


  public static void runExample(AdWordsServices adWordsServices,
      AdWordsSession session, Long campaignId, Long targetingGroupId)
      throws Exception {
    // Get the VideoTargetingGroupCriterionService
    VideoTargetingGroupCriterionServiceInterface videoTargetingGroupCriterionService =
        adWordsServices.get(session, VideoTargetingGroupCriterionServiceInterface.class);

    // Create an age criterion for age range 18 to 24.
    TargetingGroupCriterion ageCriterion = new TargetingGroupCriterion();
    ageCriterion.setCampaignId(campaignId);
    ageCriterion.setTargetingGroupId(targetingGroupId);
    AudienceAge age = new AudienceAge();
    age.setAgeRange(AudienceAgeAgeRange.AGE_RANGE_18_24);
    ageCriterion.setCriterion(age);

    TargetingGroupCriterionOperation addAgeCriterionOp =
        new TargetingGroupCriterionOperation();
    addAgeCriterionOp.setOperand(ageCriterion);
    addAgeCriterionOp.setOperator(Operator.ADD);
   
    // Create a negative age criterion for age 65+.
    NegativeTargetingGroupCriterion negativeAgeCriterion =
        new NegativeTargetingGroupCriterion();
    negativeAgeCriterion.setCampaignId(campaignId);
    negativeAgeCriterion.setTargetingGroupId(targetingGroupId);
    AudienceAge negativeAge = new AudienceAge();
    negativeAge.setAgeRange(AudienceAgeAgeRange.AGE_RANGE_65_UP);
    negativeAgeCriterion.setCriterion(negativeAge);

    TargetingGroupCriterionOperation addNegativeAgeCriterionOp =
        new TargetingGroupCriterionOperation();
    addNegativeAgeCriterionOp.setOperand(negativeAgeCriterion);
    addNegativeAgeCriterionOp.setOperator(Operator.ADD);

    // Create a gender criterion for male.
    TargetingGroupCriterion genderCriterion = new TargetingGroupCriterion();
    AudienceGender gender = new AudienceGender();
    gender.setGenderType(AudienceGenderGenderType.GENDER_MALE);
    genderCriterion.setCampaignId(campaignId);
    genderCriterion.setTargetingGroupId(targetingGroupId);
    genderCriterion.setCriterion(gender);

    TargetingGroupCriterionOperation addGenderCriterionOp =
        new TargetingGroupCriterionOperation();
    addGenderCriterionOp.setOperand(genderCriterion);
    addGenderCriterionOp.setOperator(Operator.ADD);

    // Create a topic criterion for the Autos & Vehicles topic.
    // See ConstantDataService for a list of verticals.
    TargetingGroupCriterion topicCriterion = new TargetingGroupCriterion();
    Topic topic = new Topic();
    topic.setVerticalId(47L);
    topicCriterion.setCampaignId(campaignId);
    topicCriterion.setTargetingGroupId(targetingGroupId);
    topicCriterion.setCriterion(topic);

    TargetingGroupCriterionOperation addTopicCriterionOp =
        new TargetingGroupCriterionOperation();
    addTopicCriterionOp.setOperand(topicCriterion);
    addTopicCriterionOp.setOperator(Operator.ADD);

    // Create an interest criterion for the Tablet PC interest.
    // See ConstantDataService for a list of verticals.
    TargetingGroupCriterion interestCriterion = new TargetingGroupCriterion();
    AudienceInterest interest = new AudienceInterest();
    interest.setInterestId(1277L);

    interestCriterion.setCampaignId(campaignId);
    interestCriterion.setTargetingGroupId(targetingGroupId);
    interestCriterion.setCriterion(interest);

    TargetingGroupCriterionOperation addUserInterestCriteriaOp =
        new TargetingGroupCriterionOperation();
    addUserInterestCriteriaOp.setOperand(interestCriterion);
    addUserInterestCriteriaOp.setOperator(Operator.ADD);

    TargetingGroupCriterionReturnValue result = videoTargetingGroupCriterionService.mutate(
        new TargetingGroupCriterionOperation[] {
          addAgeCriterionOp, addGenderCriterionOp,
          addNegativeAgeCriterionOp, addTopicCriterionOp,
          addUserInterestCriteriaOp});
   
View Full Code Here


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

    int offset = 0;

    // Create selector.
    TargetingGroupCriterionSelector selector = new TargetingGroupCriterionSelector();
    selector.setCampaignIds(new long[] {campaignId});
    selector.setCriterionTypes(new BaseCriterionType[] {BaseCriterionType.KEYWORD});
   
    // Display network keywords.
    selector.setCriteriaDimension(CriteriaDimension.KEYWORD);
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    TargetingGroupCriterionPage page;
    do {
      // Get all keywords.
      page = videoTargetingGroupCriterionService.get(selector);

      // Display keywords.
      if (page.getEntries() != null) {
        for (TargetingGroupCriterion targetingGroupCriterion : page.getEntries()) {
          String negative = (targetingGroupCriterion instanceof NegativeTargetingGroupCriterion)
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session,
      Long targetingGroupId) throws Exception {
    // Get the VideoCampaignCriterionService.
    VideoTargetingGroupCriterionServiceInterface videoTargetingGroupCriterionService =
        adWordsServices.get(session, VideoTargetingGroupCriterionServiceInterface.class);

    int offset = 0;

    // Create selector.
    TargetingGroupCriterionSelector selector = new TargetingGroupCriterionSelector();
    selector.setTargetingGroupIds(new long[] {targetingGroupId});
    selector.setCriteriaDimension(CriteriaDimension.KEYWORD);
    selector.setPaging(new Paging(offset, PAGE_SIZE));

    TargetingGroupCriterionPage page;
    do {
      // Get all criteria for the campaign.
      page = videoTargetingGroupCriterionService.get(selector);

      // Display criteria.
      if (page.getEntries() != null) {
        for (TargetingGroupCriterion targetingGroupCampaignCriterion : page.getEntries()) {
          String negative =
View Full Code Here

    // Create base class criterion to avoid setting keyword specific fields.
    Criterion criterion = new Criterion();
    criterion.setId(criterionId);

    // Create ad group criterion.
    AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
    adGroupCriterion.setAdGroupId(adGroupId);
    adGroupCriterion.setCriterion(criterion);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(adGroupCriterion);
    operation.setOperator(Operator.REMOVE);
View Full Code Here

    AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
    adGroupCriterion.setAdGroupId(adGroupId);
    adGroupCriterion.setCriterion(criterion);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(adGroupCriterion);
    operation.setOperator(Operator.REMOVE);

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

    // Remove ad group criteria.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);
View Full Code Here

    operation.setOperator(Operator.REMOVE);

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

    // Remove ad group criteria.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

    // Display ad group criteria.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      System.out.println("Ad group criterion with ad group id \""
          + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
          + adGroupCriterionResult.getCriterion().getId() + "\", and type \""
          + adGroupCriterionResult.getCriterion().getCriterionType() + "\" was removed.");
    }
View Full Code Here

  public static void runExample(
      AdWordsServices adWordsServices, AdWordsSession session, long adGroupId,
      long criterionId) throws Exception {
    // Get the AdGroupCriterionService.
    AdGroupCriterionServiceInterface adGroupCriterionService =
        adWordsServices.get(session, AdGroupCriterionServiceInterface.class);

    // Create base class criterion to avoid setting keyword specific fields.
    Criterion criterion = new Criterion();
    criterion.setId(criterionId);

    // Create ad group criterion.
    AdGroupCriterion adGroupCriterion = new AdGroupCriterion();
    adGroupCriterion.setAdGroupId(adGroupId);
    adGroupCriterion.setCriterion(criterion);

    // Create operations.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(adGroupCriterion);
    operation.setOperator(Operator.REMOVE);

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

    // Remove ad group criteria.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

    // Display ad group criteria.
    for (AdGroupCriterion adGroupCriterionResult : result.getValue()) {
      System.out.println("Ad group criterion with ad group id \""
          + adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
View Full Code Here

    // Get the BudgetService.
    BudgetServiceInterface budgetService =
        adWordsServices.get(session, BudgetServiceInterface.class);

    // Create a budget, which can be shared by multiple video campaigns.
    Budget sharedBudget = new Budget();
    sharedBudget.setName("Interplanetary Cruise #" + System.currentTimeMillis());
    Money budgetAmount = new Money();
    budgetAmount.setMicroAmount(50000000L);
    sharedBudget.setAmount(budgetAmount);
    sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    sharedBudget.setPeriod(BudgetBudgetPeriod.DAILY);

    BudgetOperation budgetOperation = new BudgetOperation();
    budgetOperation.setOperand(sharedBudget);
    budgetOperation.setOperator(Operator.ADD);
View Full Code Here

    budgetAmount.setMicroAmount(50000000L);
    sharedBudget.setAmount(budgetAmount);
    sharedBudget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    sharedBudget.setPeriod(BudgetBudgetPeriod.DAILY);

    BudgetOperation budgetOperation = new BudgetOperation();
    budgetOperation.setOperand(sharedBudget);
    budgetOperation.setOperator(Operator.ADD);

    // Add the budget and get the budget ID.
    BudgetReturnValue budgetResult = budgetService.mutate(
        new BudgetOperation[] {budgetOperation});
    Long budgetId = budgetResult.getValue(0).getBudgetId();
View Full Code Here

    BudgetOperation budgetOperation = new BudgetOperation();
    budgetOperation.setOperand(sharedBudget);
    budgetOperation.setOperator(Operator.ADD);

    // Add the budget and get the budget ID.
    BudgetReturnValue budgetResult = budgetService.mutate(
        new BudgetOperation[] {budgetOperation});
    Long budgetId = budgetResult.getValue(0).getBudgetId();

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

TOP

Related Classes of com.google.api.ads.adwords.axis.v201406.video.VideoTargetingGroupCriterionServiceInterface

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.