Hello Jeff, KeywordMaxCpc is ok now.
The following is the code about adding the website criterion into adGroup. String alternateUrl = "https://sandbox.google.com"; AdWordsUser user=new AdWordsUser(loginEmail, loginPassword, clientEmail, "", devToken, "", "v13",new URL(alternateUrl)); CampaignInterface campaignService = (CampaignInterface) user.getService (AdWordsUser.CAMPAIGN_SERVICE); AdGroupInterface adgroupService = (AdGroupInterface) user.getService (AdWordsUser.AD_GROUP_SERVICE); AdInterface adService = (AdInterface) user.getService(AdWordsUser.AD_SERVICE); CriterionInterface criterionService = (CriterionInterface) user.getService (AdWordsUser.CRITERION_SERVICE); Campaign newCampaign = new Campaign(); newCampaign.setBudgetAmount(new Long(100000000)); newCampaign.setBudgetPeriod(BudgetPeriod.Daily); GeoTarget g_target = new GeoTarget(); String[] countries = {"FR", "ES"}; CountryTargets country = new CountryTargets(); country.setCountries(countries); g_target.setCountryTargets(country); newCampaign.setGeoTargeting(g_target); String[] languages = {"en", "fr", "es"}; newCampaign.setLanguageTargeting(languages); newCampaign.setStatus(CampaignStatus.Paused); newCampaign = campaignService.addCampaign(newCampaign); int campaign_id = newCampaign.getId(); AdGroup myAdGroup = new AdGroup(); myAdGroup.setKeywordMaxCpc(new Long(1000000)); AdGroup newAdGroup = adgroupService.addAdGroup(campaign_id, myAdGroup); long adgroup_id = newAdGroup.getId(); TextAd myAd = new TextAd(); myAd.setHeadline("AdWords API Dev Guide"); myAd.setDescription1("Access your AdWords"); myAd.setDescription2("accounts programmatically"); myAd.setDisplayUrl("blog.chanezon.com"); myAd.setDestinationUrl("http://blog.chanezon.com/"); myAd.setAdGroupId(adgroup_id); Ad[] ads = new Ad[1]; ads[0] = myAd; ads = adService.addAds(ads); Website website1 = new Website(); website1.setCriterionType(CriterionType.Website); website1.setUrl("example.com"); boolean noError = false; Criterion[] newWebsite ; String[] languageTarget = new String[] {"en"}; GeoTarget geoTarget = new GeoTarget(); geoTarget.setCountryTargets(new CountryTargets(new String[] {"US"},new String[]{})); ApiError[] errors = criterionService.checkCriteria(new Criterion[] {website1}, languageTarget, geoTarget); if (errors == null) { noError = true; } if(noError) newWebsite = criterionService.addCriteria(new Criterion[] {website1}); The null error appears at this sentence whether I checked criteria or not. if(noError) newWebsite = criterionService.addCriteria(new Criterion [] {website1}); Adding keyword and Ad are ok. I used the same infomation about account. Thanks and best regards, PPL On Apr 2, 11:16 pm, AdWords API Advisor <adwordsapiadvi...@google.com> wrote: > Hello PPL, > > You can use JPY as your currency, but I don't think you can specify > 1/10 of a Yen as a valid bid. Try specifying a number that's a > multiple of 1000000--for example, 5000000 would be a bid of 5 Yen. > > As I mentioned upthread, in order to troubleshoot, could you please > post the XML from a SOAP request to the Sandbox and response (with > your email and password information X-ed out) illustrating the issue > you're having? > > Cheers, > -Jeff Posnick, AdWords API Team > > On Apr 2, 5:50 am, PPL <ppl...@gmail.com> wrote: > > > > > Hello Jeff, > > > Now I'm using JPY at the end of the Sandbox Developer token. > > Do I need to use specific currency code like USD or whatever? > > And there is one more question about adding Website Criterion into the > > adgroup. > > Whenever I add the website criterion into the adgroup it leads to null > > exception, > > although I can add keyword criterion into the adgroup and I'm not > > adding both keyword and website in the same adgroup. > > Could you please help me? > > > Thanks and best regards, > > PPL > > > On Apr 2, 1:44 am, AdWords API Advisor <adwordsapiadvi...@google.com> > > wrote: > > > > Hello, > > > > Which currency code are you using after the '++' at the end of your > > > Sandbox Developer token? It sounds like whichever one you're using > > > can't be easily broken down into tenths for billing purposes. (100000 > > > micros = 1/10 of one unit of currency.) > > > > Cheers, > > > -Jeff Posnick, AdWords API Team > > > > On Apr 1, 12:22 am, PPL <ppl...@gmail.com> wrote: > > > > > Now I've got it Jeff. > > > > It was because of the database refresh. > > > > Thank you for your care. > > > > > And I have one more question about keyword max cpc. > > > > Whenever I add adgroup into the campaign, the following error was > > > > appeared. > > > > > Exception in thread "main" AxisFault > > > > faultCode: {http://schemas.xmlsoap.org/soap/envelope/} > > > > Server.userException > > > > faultSubcode: > > > > faultString: One or more input elements failed validation. > > > > faultActor: > > > > faultNode: > > > > faultDetail: > > > > {https://adwords.google.com/api/adwords/v13}fault: > > > > <ns1:code>122</ns1:code> > > > > > <ns1:message>One or more input elements failed validation.</ > > > > ns1:message> > > > > > <ns1:errors> > > > > <ns1:index>0</ns1:index> > > > > > <ns1:field>keywordMaxCpc</ns1:field> > > > > > <ns1:trigger>100000</ns1:trigger> > > > > > <ns1:code>75</ns1:code> > > > > > <ns1:isExemptable>false</ns1:isExemptable> > > > > > <ns1:detail>The bid must be a multiple of the billable unit.</ > > > > ns1:detail> > > > > > </ns1:errors> > > > > > So, could you please tell me what should be the multiple of the > > > > billable unit about the keywordMaxCpc. > > > > > Thanks and best regards, > > > > PPL > > > > > On Mar 31, 10:33 pm, AdWords API Advisor > > > > > <adwordsapiadvi...@google.com> wrote: > > > > > Hello, > > > > > > Before debugging this further, I wanted to point out that the > > > > > Sandbox's backend database had its monthly refresh this past Friday > > > > > (seehttp://groups.google.com/group/adwords-api/browse_thread/thread/92e92...), > > > > > so any existing campaigns created before then will have to be > > > > > recreated. > > > > > > If that's not the issue, could you please post the XML from a SOAP > > > > > request to the Sandbox and response (with your email and password > > > > > information X-ed out) illustrating the issue you're having? > > > > > > Cheers, > > > > > -Jeff Posnick, AdWords API Team > > > > > > On Mar 31, 2:32 am, PPL <ppl...@gmail.com> wrote: > > > > > > > Hi, > > > > > > I'm facing a problem in using getAllAdWordsCampaigns() and > > > > > > getCampaign > > > > > > () methods of Campaign Service on SandBox. Whenever I called those > > > > > > methods it leads to exception of null although I set everything > > > > > > about > > > > > > the AdwordsUser correctly. I use the following constructor to create > > > > > > AdwordsUser. > > > > > > AdWordsUser user=new AdWordsUser(loginEmail, loginPassword, > > > > > > clientEmail, > > > > > > userAgent, developerToken, "", > > > > > > "v13",new URL("https://sandbox.google.com")); > > > > > > > And I've already add campaigns by using addCampaign() method. > > > > > > campaignService.addCampaign(newCampaign). > > > > > > and I got the id of the new campaign. But when I get back the > > > > > > campaign > > > > > > by passing that id to getCampaign() method it also ends up to null > > > > > > exception. Could u please help me? I'm facing the same exception in > > > > > > adding adgroups into sandbox too. > > > > > > Thanks > > > > > > PPL- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en -~----------~----~----~----~------~----~------~--~---