Re: GoogleAdsAPI: How to change individual keyword bids back to the ad group default bid?

2019-10-01 Thread
I could change cpc bid to default.
Many thanks for your helps!
 

On Tuesday, October 1, 2019 at 11:22:46 PM UTC+9, adsapiforumadvisor wrote:
>
> Hello,
>
> Regret the delay. If you need to work with an existing object to update a 
> few fields, you will need to create the FieldMask from the scratch as 
> mentioned in this guide 
> .
>  
> You don’t need to use clearCpcBidMicros() to explicitly set the value to 
> default. Please find the code snippet below for your reference:  
>
> FieldMask fieldMask = FieldMask.newBuilder()
> .addPaths("cpc_bid_micros")
> .build();
>
> I hope this helps. Please let me know if you have any further concerns.
>
> Thanks,
> Bharani, Google Ads API Team
>
>
> ref:_00D1U1174p._5001UKLSzk: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/461ff853-733a-46c8-854b-c02ce19f6ede%40googlegroups.com.


GoogleAdsAPI: How to change individual keyword bids back to the ad group default bid?

2019-09-29 Thread
I use Google Ads API Client Library for Java v2.


I edited individual keyword bid.

Long bidMicroAmount = Long.parseLong("100");
AdGroupCriterion adGroupCriterion =
AdGroupCriterion.newBuilder()
.setResourceName(ResourceNames.adGroupCriterion(customerId, 
adGroupId, criterionId))
.setCpcBidMicros(Int64Value.of(bidMicroAmount))
.build();
AdGroupCriterionOperation operation =
AdGroupCriterionOperation.newBuilder()
.setUpdate(adGroupCriterion)
.setUpdateMask(FieldMasks.allSetFieldsOf(adGroupCriterion))
.build();
MutateAdGroupCriteriaResponse response =
adGroupCriterionServiceClient.mutateAdGroupCriteria(
Long.toString(customerId), ImmutableList.of(operation));
It works.


Now, I need to change back to the ad group default bid.

First, I tried set bidMicroAmount to 0.

Long bidMicroAmount = Long.parseLong("0");

but it failed with INVALID_VALUE error.
  message: "The field's value is invalid."
  trigger: { int64_value: 0 }

Next, I tried clearCpcBidMicros() at build AdGroupCriterion.

AdGroupCriterion adGroupCriterion =
AdGroupCriterion.newBuilder()
.setResourceName(ResourceNames.adGroupCriterion(customerId, 
adGroupId, criterionId))
.clearCpcBidMicros()
.build();

It works without errors, bud no change keyword bid and bid source.

And I use setEffectiveCpcBidSource(BiddingSource.AD_GROUP) instead of 
clearCpcBidMicros(),
that works equally clearCpcBidMicros(), with no change.


How can I change back to ad group default bid ?

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/526a41b1-6582-4671-babd-ca4979716d14%40googlegroups.com.