RE: How to update keyword MaxCPC via api in php
Hello, You can refer to this example which updates a keyword's bid in PHP. Cheers, Anthony Google Ads API Team Anthony Google Ads API Team ref:_00D1U1174p._5004Q27u6Mf:ref -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads 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 --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/sUNRg0QJWEFF00YRYfSRmQTFeG5pJ84A3nyw%40sfdc.net.
How to update keyword MaxCPC via api in php
Hi How can I update the keyword MaxCPC in php via google ads api? I am using following code, but nothing was changed after trying. if (!is_null($cpcAmount)) { $bid = new \Google\AdsApi\AdWords\v201809\cm\CpcBid(); $money = new \Google\AdsApi\AdWords\v201809\cm\Money(); $money->setMicroAmount($cpcAmount * 100); $bid->setBid($money); $biddingStrategyConfiguration = new \Google\AdsApi\AdWords\v201809\cm\BiddingStrategyConfiguration(); $biddingStrategyConfiguration->setBids([$bid]); $adGroup->setBiddingStrategyConfiguration($biddingStrategyConfiguration); } // Create ad group operation and add it to the list. $operation = new AdGroupOperation(); $operation->setOperand($adGroup); $operation->setOperator(Operator::SET); $operations[] = $operation; // Update the ad group on the server. return $adGroupService->mutate($operations); Could you please help why it is not updating the changed value? Thanks -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads 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 --- You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d37434ec-0a28-45c1-b84d-0a0f9cb63036n%40googlegroups.com.
Re: update keyword maxcpc
Hi, Take a look at this example https://code.google.com/p/google-api-ads-java/source/browse/examples/adwords_axis/src/main/java/adwords/axis/v201302/basicoperations/UpdateKeyword.java Best, - David Torres - AdWords API Team On Thursday, April 4, 2013 6:07:13 AM UTC-4, Aere wrote: > > I don't understand your code... where you instantiate > "keywordBiddableAdGroupCriterion"? > > Il giorno domenica 31 marzo 2013 21:06:20 UTC+2, Oliver ha scritto: >> >> I just tried the following code for a keyword and it seems to be working: >> >> >> BiddingStrategyConfiguration biddingStrategyConfiguration = new >> BiddingStrategyConfiguration(); >> CpcBid bid = new CpcBid(); >> bid.setBid(bidAmount); >> biddingStrategyConfiguration.setBids(new Bids[] {bid}); >> >> keywordBiddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration); >> >> >> Oliver >> >> On Sunday, March 31, 2013 9:46:36 AM UTC+1, F.Per wrote: >>> >>> There is nothing similar to setBiddingStrategyConfiguration for the >>> keyword (com.google.api.ads.adwords.axis.v201302.cm) >>> >>> Anybody has an idea? >>> >>> >>> Am Mittwoch, 27. März 2013 09:35:52 UTC+1 schrieb F.Per: Hi im using java (v201302) and i want to update a list of already EXISTING keywords. I downloaded all the information i need about them and i want to update their maxCpc. Ive written the following code, but there is no obvious way for me to set the maxCpc attribute: [code] // create client login token String clientLoginToken = new ClientLoginTokens.Builder() .forApi(ClientLoginTokens.Api.ADWORDS) .withEmailAndPassword("myEmail", "myPassword") .build() .requestToken(); // Construct an AdWordsSession. AdWordsSession session = new AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); AdWordsServices adWordsServices = new AdWordsServices(); try { // Get the AdGroupService. AdGroupServiceInterface adGroupService = adWordsServices.get(session, AdGroupServiceInterface.class); List operationList = new ArrayList(); // loop throuh existing keywords (google ids) for(Long keywordId : keywordIds) { Keyword googleKeyword = new Keyword(); googleKeyword.setId(keywordId); googleKeyword.setMatchType(KeywordMatchType.BROAD); // how to update maxcpc ? BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); biddableAdGroupCriterion.setAdGroupId(someAdGroupId); biddableAdGroupCriterion.setCriterion(googleKeyword); AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); adGroupCriterionOperation.setOperator(Operator.SET); operationList.add(adGroupCriterionOperation); AdGroupOperation[] operations = (AdGroupOperation[]) operationList.toArray(); // Update ad group. AdGroupReturnValue result = adGroupService.mutate(operations); } } catch (Exception e) { e.printStackTrace(); } [/code] Either i am not getting how to set this or it has to be done in another way. Can somebody help me with this? Id really appreciate it. thx -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: update keyword maxcpc
I don't understand your code... where you instantiate "keywordBiddableAdGroupCriterion"? Il giorno domenica 31 marzo 2013 21:06:20 UTC+2, Oliver ha scritto: > > I just tried the following code for a keyword and it seems to be working: > > > BiddingStrategyConfiguration biddingStrategyConfiguration = new > BiddingStrategyConfiguration(); > CpcBid bid = new CpcBid(); > bid.setBid(bidAmount); > biddingStrategyConfiguration.setBids(new Bids[] {bid}); > > keywordBiddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration); > > > Oliver > > On Sunday, March 31, 2013 9:46:36 AM UTC+1, F.Per wrote: >> >> There is nothing similar to setBiddingStrategyConfiguration for the >> keyword (com.google.api.ads.adwords.axis.v201302.cm) >> >> Anybody has an idea? >> >> >> Am Mittwoch, 27. März 2013 09:35:52 UTC+1 schrieb F.Per: >>> >>> Hi >>> >>> im using java (v201302) and i want to update a list of already EXISTING >>> keywords. I downloaded all the information i need about them and i want to >>> update their maxCpc. >>> Ive written the following code, but there is no obvious way for me to >>> set the maxCpc attribute: >>> >>> [code] >>> // create client login token >>> String clientLoginToken = new ClientLoginTokens.Builder() >>> .forApi(ClientLoginTokens.Api.ADWORDS) >>> .withEmailAndPassword("myEmail", "myPassword") >>> .build() >>> .requestToken(); >>> >>> // Construct an AdWordsSession. >>> AdWordsSession session = new >>> AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); >>> >>> AdWordsServices adWordsServices = new AdWordsServices(); >>> >>> try { >>> // Get the AdGroupService. >>> AdGroupServiceInterface adGroupService = >>> adWordsServices.get(session, AdGroupServiceInterface.class); >>> >>> List operationList = new >>> ArrayList(); >>> >>> // loop throuh existing keywords (google ids) >>> for(Long keywordId : keywordIds) { >>> Keyword googleKeyword = new Keyword(); >>> googleKeyword.setId(keywordId); >>> googleKeyword.setMatchType(KeywordMatchType.BROAD); >>> // how to update maxcpc ? >>> >>> BiddableAdGroupCriterion biddableAdGroupCriterion = new >>> BiddableAdGroupCriterion(); >>> biddableAdGroupCriterion.setAdGroupId(someAdGroupId); >>> biddableAdGroupCriterion.setCriterion(googleKeyword); >>> >>> AdGroupCriterionOperation adGroupCriterionOperation = >>> new AdGroupCriterionOperation(); >>> >>> adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); >>> adGroupCriterionOperation.setOperator(Operator.SET); >>> >>> operationList.add(adGroupCriterionOperation); >>> >>> AdGroupOperation[] operations = (AdGroupOperation[]) >>> operationList.toArray(); >>> >>> // Update ad group. >>> AdGroupReturnValue result = >>> adGroupService.mutate(operations); >>> } >>> } catch (Exception e) { >>> e.printStackTrace(); >>> } >>> [/code] >>> >>> Either i am not getting how to set this or it has to be done in another >>> way. >>> >>> Can somebody help me with this? Id really appreciate it. >>> >>> thx >>> >>> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: update keyword maxcpc
I just tried the following code for a keyword and it seems to be working: BiddingStrategyConfiguration biddingStrategyConfiguration = new BiddingStrategyConfiguration(); CpcBid bid = new CpcBid(); bid.setBid(bidAmount); biddingStrategyConfiguration.setBids(new Bids[] {bid}); keywordBiddableAdGroupCriterion.setBiddingStrategyConfiguration(biddingStrategyConfiguration); Oliver On Sunday, March 31, 2013 9:46:36 AM UTC+1, F.Per wrote: > > There is nothing similar to setBiddingStrategyConfiguration for the > keyword (com.google.api.ads.adwords.axis.v201302.cm) > > Anybody has an idea? > > > Am Mittwoch, 27. März 2013 09:35:52 UTC+1 schrieb F.Per: >> >> Hi >> >> im using java (v201302) and i want to update a list of already EXISTING >> keywords. I downloaded all the information i need about them and i want to >> update their maxCpc. >> Ive written the following code, but there is no obvious way for me to set >> the maxCpc attribute: >> >> [code] >> // create client login token >> String clientLoginToken = new ClientLoginTokens.Builder() >> .forApi(ClientLoginTokens.Api.ADWORDS) >> .withEmailAndPassword("myEmail", "myPassword") >> .build() >> .requestToken(); >> >> // Construct an AdWordsSession. >> AdWordsSession session = new >> AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); >> >> AdWordsServices adWordsServices = new AdWordsServices(); >> >> try { >> // Get the AdGroupService. >> AdGroupServiceInterface adGroupService = >> adWordsServices.get(session, AdGroupServiceInterface.class); >> >> List operationList = new >> ArrayList(); >> >> // loop throuh existing keywords (google ids) >> for(Long keywordId : keywordIds) { >> Keyword googleKeyword = new Keyword(); >> googleKeyword.setId(keywordId); >> googleKeyword.setMatchType(KeywordMatchType.BROAD); >> // how to update maxcpc ? >> >> BiddableAdGroupCriterion biddableAdGroupCriterion = new >> BiddableAdGroupCriterion(); >> biddableAdGroupCriterion.setAdGroupId(someAdGroupId); >> biddableAdGroupCriterion.setCriterion(googleKeyword); >> >> AdGroupCriterionOperation adGroupCriterionOperation = new >> AdGroupCriterionOperation(); >> >> adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); >> adGroupCriterionOperation.setOperator(Operator.SET); >> >> operationList.add(adGroupCriterionOperation); >> >> AdGroupOperation[] operations = (AdGroupOperation[]) >> operationList.toArray(); >> >> // Update ad group. >> AdGroupReturnValue result = >> adGroupService.mutate(operations); >> } >> } catch (Exception e) { >> e.printStackTrace(); >> } >> [/code] >> >> Either i am not getting how to set this or it has to be done in another >> way. >> >> Can somebody help me with this? Id really appreciate it. >> >> thx >> >> -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: update keyword maxcpc
There is nothing similar to setBiddingStrategyConfiguration for the keyword (com.google.api.ads.adwords.axis.v201302.cm) Anybody has an idea? Am Mittwoch, 27. März 2013 09:35:52 UTC+1 schrieb F.Per: > > Hi > > im using java (v201302) and i want to update a list of already EXISTING > keywords. I downloaded all the information i need about them and i want to > update their maxCpc. > Ive written the following code, but there is no obvious way for me to set > the maxCpc attribute: > > [code] > // create client login token > String clientLoginToken = new ClientLoginTokens.Builder() > .forApi(ClientLoginTokens.Api.ADWORDS) > .withEmailAndPassword("myEmail", "myPassword") > .build() > .requestToken(); > > // Construct an AdWordsSession. > AdWordsSession session = new > AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); > > AdWordsServices adWordsServices = new AdWordsServices(); > > try { > // Get the AdGroupService. > AdGroupServiceInterface adGroupService = > adWordsServices.get(session, AdGroupServiceInterface.class); > > List operationList = new > ArrayList(); > > // loop throuh existing keywords (google ids) > for(Long keywordId : keywordIds) { > Keyword googleKeyword = new Keyword(); > googleKeyword.setId(keywordId); > googleKeyword.setMatchType(KeywordMatchType.BROAD); > // how to update maxcpc ? > > BiddableAdGroupCriterion biddableAdGroupCriterion = new > BiddableAdGroupCriterion(); > biddableAdGroupCriterion.setAdGroupId(someAdGroupId); > biddableAdGroupCriterion.setCriterion(googleKeyword); > > AdGroupCriterionOperation adGroupCriterionOperation = new > AdGroupCriterionOperation(); > > adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); > adGroupCriterionOperation.setOperator(Operator.SET); > > operationList.add(adGroupCriterionOperation); > > AdGroupOperation[] operations = (AdGroupOperation[]) > operationList.toArray(); > > // Update ad group. > AdGroupReturnValue result = > adGroupService.mutate(operations); > } > } catch (Exception e) { > e.printStackTrace(); > } > [/code] > > Either i am not getting how to set this or it has to be done in another > way. > > Can somebody help me with this? Id really appreciate it. > > thx > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: update keyword maxcpc
See the example code in the bidding guide: https://developers.google.com/adwords/api/docs/guides/bidding it sets the bid on the adgroup, but the code to do the same on keywords should be similar. Oliver On Wednesday, March 27, 2013 8:35:52 AM UTC, F.Per wrote: > > Hi > > im using java (v201302) and i want to update a list of already EXISTING > keywords. I downloaded all the information i need about them and i want to > update their maxCpc. > Ive written the following code, but there is no obvious way for me to set > the maxCpc attribute: > > [code] > // create client login token > String clientLoginToken = new ClientLoginTokens.Builder() > .forApi(ClientLoginTokens.Api.ADWORDS) > .withEmailAndPassword("myEmail", "myPassword") > .build() > .requestToken(); > > // Construct an AdWordsSession. > AdWordsSession session = new > AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); > > AdWordsServices adWordsServices = new AdWordsServices(); > > try { > // Get the AdGroupService. > AdGroupServiceInterface adGroupService = > adWordsServices.get(session, AdGroupServiceInterface.class); > > List operationList = new > ArrayList(); > > // loop throuh existing keywords (google ids) > for(Long keywordId : keywordIds) { > Keyword googleKeyword = new Keyword(); > googleKeyword.setId(keywordId); > googleKeyword.setMatchType(KeywordMatchType.BROAD); > // how to update maxcpc ? > > BiddableAdGroupCriterion biddableAdGroupCriterion = new > BiddableAdGroupCriterion(); > biddableAdGroupCriterion.setAdGroupId(someAdGroupId); > biddableAdGroupCriterion.setCriterion(googleKeyword); > > AdGroupCriterionOperation adGroupCriterionOperation = new > AdGroupCriterionOperation(); > > adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); > adGroupCriterionOperation.setOperator(Operator.SET); > > operationList.add(adGroupCriterionOperation); > > AdGroupOperation[] operations = (AdGroupOperation[]) > operationList.toArray(); > > // Update ad group. > AdGroupReturnValue result = > adGroupService.mutate(operations); > } > } catch (Exception e) { > e.printStackTrace(); > } > [/code] > > Either i am not getting how to set this or it has to be done in another > way. > > Can somebody help me with this? Id really appreciate it. > > thx > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
update keyword maxcpc
Hi im using java (v201302) and i want to update a list of already EXISTING keywords. I downloaded all the information i need about them and i want to update their maxCpc. Ive written the following code, but there is no obvious way for me to set the maxCpc attribute: [code] // create client login token String clientLoginToken = new ClientLoginTokens.Builder() .forApi(ClientLoginTokens.Api.ADWORDS) .withEmailAndPassword("myEmail", "myPassword") .build() .requestToken(); // Construct an AdWordsSession. AdWordsSession session = new AdWordsSession.Builder().fromFile().withClientLoginToken(clientLoginToken).build(); AdWordsServices adWordsServices = new AdWordsServices(); try { // Get the AdGroupService. AdGroupServiceInterface adGroupService = adWordsServices.get(session, AdGroupServiceInterface.class); List operationList = new ArrayList(); // loop throuh existing keywords (google ids) for(Long keywordId : keywordIds) { Keyword googleKeyword = new Keyword(); googleKeyword.setId(keywordId); googleKeyword.setMatchType(KeywordMatchType.BROAD); // how to update maxcpc ? BiddableAdGroupCriterion biddableAdGroupCriterion = new BiddableAdGroupCriterion(); biddableAdGroupCriterion.setAdGroupId(someAdGroupId); biddableAdGroupCriterion.setCriterion(googleKeyword); AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation(); adGroupCriterionOperation.setOperand(biddableAdGroupCriterion); adGroupCriterionOperation.setOperator(Operator.SET); operationList.add(adGroupCriterionOperation); AdGroupOperation[] operations = (AdGroupOperation[]) operationList.toArray(); // Update ad group. AdGroupReturnValue result = adGroupService.mutate(operations); } } catch (Exception e) { e.printStackTrace(); } [/code] Either i am not getting how to set this or it has to be done in another way. Can somebody help me with this? Id really appreciate it. thx -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.