Package com.google.api.adwords.v201008.cm

Examples of com.google.api.adwords.v201008.cm.AdExtensionOverrideReturnValue


   */
  public void testValidCreateCampaign() throws Exception {
    Campaign campaign = new Campaign();
    campaign.setName("Test Campaign " + System.currentTimeMillis());
    campaign.setStatus(CampaignStatus.PAUSED);
    campaign.setBiddingStrategy(new ManualCPC());

    // Create budget.
    Budget budget = new Budget();
    budget.setPeriod(BudgetBudgetPeriod.DAILY);
    budget.setAmount(new Money(null, 50000000L));
View Full Code Here


    adGroup.setName("Earth to Mars Cruises #" + System.currentTimeMillis());
    adGroup.setStatus(AdGroupStatus.ENABLED);
    adGroup.setCampaignId(campaignId);

    // Create ad group bid.
    ManualCPCAdGroupBids adGroupBids = new ManualCPCAdGroupBids();
    adGroupBids.setKeywordMaxCpc(new Bid(new Money(null, 10000000L)));
    adGroup.setBids(adGroupBids);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
View Full Code Here

    campaign.setStatus(CampaignStatus.PAUSED);

    // Create budget
    Budget budget = new Budget();
    budget.setPeriod(BudgetBudgetPeriod.DAILY);
    budget.setAmount(new Money(null, 50000000L));
    budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    campaign.setBudget(budget);

    // Create operations.
    CampaignOperation operation = new CampaignOperation();
View Full Code Here

    adGroup.setStatus(AdGroupStatus.ENABLED);
    adGroup.setCampaignId(campaignId);

    // Create ad group bid.
    ManualCPCAdGroupBids adGroupBids = new ManualCPCAdGroupBids();
    adGroupBids.setKeywordMaxCpc(new Bid(new Money(null, 10000000L)));
    adGroup.setBids(adGroupBids);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
View Full Code Here

    campaign.setBiddingStrategy(new ManualCPC());

    // Create budget.
    Budget budget = new Budget();
    budget.setPeriod(BudgetBudgetPeriod.DAILY);
    budget.setAmount(new Money(null, 50000000L));
    budget.setDeliveryMethod(BudgetBudgetDeliveryMethod.STANDARD);
    campaign.setBudget(budget);

    // Create operations.
    CampaignOperation operation = new CampaignOperation();
View Full Code Here

    Keyword keyword = new Keyword();
    keyword.setText("jupiter cruise");
    keyword.setMatchType(KeywordMatchType.BROAD);

    // Create negative campaign criterion.
    NegativeCampaignCriterion negativeCampaignCriterion = new NegativeCampaignCriterion();
    negativeCampaignCriterion.setCampaignId(campaignId);
    negativeCampaignCriterion.setCriterion(keyword);

    // Create operations.
    CampaignCriterionOperation operation = new CampaignCriterionOperation();
    operation.setOperand(negativeCampaignCriterion);
    operation.setOperator(Operator.ADD);
View Full Code Here

    NetworkTargetList networkTargetList = new NetworkTargetList();
    networkTargetList.setCampaignId(campaignId);
    networkTargetList.setTargets(new NetworkTarget[] {
        // Specifying GOOGLE_SEARCH is necessary if you want to target
        // SEARCH_NETWORK.
        new NetworkTarget(null, NetworkCoverageType.GOOGLE_SEARCH),
        new NetworkTarget(null, NetworkCoverageType.SEARCH_NETWORK)});

    CampaignTargetOperation languageTargetOperation = new CampaignTargetOperation();
    languageTargetOperation.setOperand(languageTargetList);
    languageTargetOperation.setOperator(Operator.SET);
View Full Code Here

    geoTargetList.setCampaignId(campaignId);
    geoTargetList.setTargets(new GeoTarget[] {new CountryTarget(null, false, "US"),
        new CountryTarget(null, false, "JP")});

    // Create network targets.
    NetworkTargetList networkTargetList = new NetworkTargetList();
    networkTargetList.setCampaignId(campaignId);
    networkTargetList.setTargets(new NetworkTarget[] {
        // Specifying GOOGLE_SEARCH is necessary if you want to target
        // SEARCH_NETWORK.
        new NetworkTarget(null, NetworkCoverageType.GOOGLE_SEARCH),
        new NetworkTarget(null, NetworkCoverageType.SEARCH_NETWORK)});

    CampaignTargetOperation languageTargetOperation = new CampaignTargetOperation();
    languageTargetOperation.setOperand(languageTargetList);
    languageTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation geoTargetOperation = new CampaignTargetOperation();
    geoTargetOperation.setOperand(geoTargetList);
    geoTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation networkTargetOperation = new CampaignTargetOperation();
    networkTargetOperation.setOperand(networkTargetList);
    networkTargetOperation.setOperator(Operator.SET);

    CampaignTargetOperation[] operations = new CampaignTargetOperation[] {languageTargetOperation,
        geoTargetOperation, networkTargetOperation};

    // Set campaign targets.
    CampaignTargetReturnValue result = service.mutate(operations);

    // Exclude generated fields and test objects.
    if (result != null && result.getValue() != null) {
      for (TargetList testList : result.getValue()) {

        if (testList.getTargetListType().equals("LanguageTargetList")) {
          languageTargetList.setTargetListType(testList.getTargetListType());
          for (LanguageTarget languageTarget : languageTargetList.getTargets()) {
            languageTarget.setTargetType(((LanguageTarget) ((LanguageTargetList) testList)
                .getTargets()[0]).getTargetType());
          }
          TestUtils.assertDeepReflectionEquals(languageTargetList, testList);

        } else if (testList.getTargetListType().equals("GeoTargetList")) {
          geoTargetList.setTargetListType(testList.getTargetListType());
          for (GeoTarget geoTarget : geoTargetList.getTargets()){
            geoTarget.setTargetType(((GeoTarget)((GeoTargetList) testList)
                .getTargets()[0]).getTargetType());
          }
          TestUtils.assertDeepReflectionEquals(geoTargetList, testList);

        } else if (testList.getTargetListType().equals("NetworkTargetList")) {
          networkTargetList.setTargetListType(testList.getTargetListType());
          for (NetworkTarget networkTarget : networkTargetList.getTargets()){
            networkTarget.setTargetType(((NetworkTarget)((NetworkTargetList) testList)
                .getTargets()[0]).getTargetType());
          }
          TestUtils.assertDeepReflectionEquals(networkTargetList, testList);
        }
View Full Code Here

    BiddableAdGroupCriterion keywordBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    keywordBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    keywordBiddableAdGroupCriterion.setCriterion(keyword);

    // Create placement.
    Placement placement = new Placement();
    placement.setUrl("http://mars.google.com");

    // Create biddable ad group criterion for placement.
    BiddableAdGroupCriterion placementBiddableAdGroupCriterion = new BiddableAdGroupCriterion();
    placementBiddableAdGroupCriterion.setAdGroupId(adGroupId);
    placementBiddableAdGroupCriterion.setCriterion(placement);
View Full Code Here

    // Get the AdGroupAdService.
    AdGroupAdServiceInterface adGroupAdService =
        user.getService(AdWordsService.V201008.ADGROUP_AD_SERVICE);

    // Create text ad.
    TextAd textAd = new TextAd();
    textAd.setHeadline("Luxury Cruise to Mars");
    textAd.setDescription1("Visit the Red Planet in style.");
    textAd.setDescription2("Low-gravity fun for everyone!");
    textAd.setDisplayUrl("www.example.com");
    textAd.setUrl("http://www.example.com");

    // Create ad group ad.
    AdGroupAd textAdGroupAd = new AdGroupAd();
    textAdGroupAd.setAdGroupId(adGroupId);
    textAdGroupAd.setAd(textAd);
View Full Code Here

TOP

Related Classes of com.google.api.adwords.v201008.cm.AdExtensionOverrideReturnValue

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.