I use Google Ads API Client Library for Java v2.
I edited individual keyword bid.
Long bidMicroAmount = Long.parseLong("1000000");
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/526a41b1-6582-4671-babd-ca4979716d14%40googlegroups.com.