Cannot change campaign strategy

45 views
Skip to first unread message

ewin zhou

unread,
Jun 30, 2021, 8:01:06 AM6/30/21
to AdWords API and Google Ads API Forum
i cannot change campaign to MaximizeConversions

Campaign.Builder builder = Campaign.newBuilder();
builder.setMaximizeConversionValue(MaximizeConversionValue.newBuilder().build());
Campaign campaign = builder.setResourceName("customers/2150330500/campaigns/13473505627").build();
try (CampaignServiceClient serviceClient =
client.getLatestVersion().createCampaignServiceClient()) {
CampaignOperation operation = CampaignOperation.newBuilder()
.setUpdate(campaign)
.setUpdateMask(FieldMasks.allSetFieldsOf(campaign))
.build();
MutateCampaignsResponse response = serviceClient.mutateCampaigns("2150330500", ImmutableList.of(operation));
// Prints the resource name of each updated object.
for (MutateCampaignResult mutateResult : response.getResultsList()) {
System.out.println(mutateResult);
}
} catch (GoogleAdsException e) {
e.printStackTrace();
}

but it  works for campaign create

Campaign campaign =
Campaign.newBuilder()
.setName("API Campaign")
.setAdvertisingChannelType(AdvertisingChannelTypeEnum.AdvertisingChannelType.SEARCH)
.setStatus(CampaignStatusEnum.CampaignStatus.PAUSED)
.setCampaignBudget("customers/2150330500/campaignBudgets/9022513393")
.setMaximizeConversions(MaximizeConversions.newBuilder().build())
.setStartDate("20210630")
.setEndDate("20211111")
.build();
CampaignBudget.Builder builder = CampaignBudget.newBuilder()
.setName("API_Campaign_Campaign")
.setDeliveryMethod(BudgetDeliveryMethodEnum.BudgetDeliveryMethod.valueOf("STANDARD"))
.setAmountMicros(300000000L)
.setExplicitlyShared(false)
;

Google Ads API Forum Advisor

unread,
Jul 5, 2021, 1:12:37 AM7/5/21
to ewin...@gmail.com, adwor...@googlegroups.com
Hi Ewin,

Thank you for reaching out.

So that our team may take a closer look, could you also provide the complete request and response logs, with the request-id, generated when you performed an UPDATE request? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2JXUbL:ref

Pete Lavetsky (AdWords API Guru)

unread,
Jul 6, 2021, 12:02:45 PM7/6/21
to AdWords API and Google Ads API Forum
Ewin,

Check out this thread for the answer: https://github.com/googleads/google-ads-java/issues/272

Pete

Google Ads API Forum Advisor

unread,
Jul 9, 2021, 11:03:53 AM7/9/21
to ewin...@gmail.com, adwor...@googlegroups.com
Hello,

Thanks for reaching out. As this appears to be a client library specific issue, I recommend checking the Java CL GitHub issues thread linked by Pete for more information on this.

Regards,
Matt
Google Ads API Team

Google Logo
Matt
Google Ads API Team
 


ref:_00D1U1174p._5004Q2JXUbL:ref
Reply all
Reply to author
Forward
0 new messages