We also started getting this same error this morning when trying to do the 
same thing in the PHP SDK. Changing the bid strategy from max cv -> TCPA 
worked yesterday and last week, but now we get this error. Did something 
change in the API?

On Wednesday, October 2, 2024 at 8:25:27 AM UTC-4 Yigitalp (Alp) Korpe 
wrote:

> Hi Team, 
>
> I want to set my campaign's bid strategy to Target CPA but I am getting 
> following error. Could you please help me on it? 
> FaultMessage: The operation is not allowed for the given context.
> Request with ID '****' failed with status 'INVALID_ARGUMENT' and includes 
> the following errors:
>         Error with message 'The operation is not allowed for the given 
> context.'.
>
> please find the code below
> campaign_service = client.get_service("CampaignService")
> campaign_operation = client.get_type("CampaignOperation")
> campaign = campaign_operation.update
> campaign.resource_name = campaign_resource_name
> campaign.bidding_strategy_type = (
> client.enums.BiddingStrategyTypeEnum.TARGET_CPA
> )
> campaign.target_cpa.target_cpa_micros = 35000000
>
> # Set the update mask.
> client.copy_from(
> campaign_operation.update_mask,
> protobuf_helpers.field_mask(None, campaign._pb),
> )
>
> try:
> # Issue a mutate request to update the campaign.
> campaign_response = campaign_service.mutate_campaigns(
> customer_id=account.id, operations=[campaign_operation]
> )
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/73e6a6eb-8520-4c6e-b514-f92f3dcd7872n%40googlegroups.com.
  • Setting bi... 'Yigitalp (Alp) Korpe' via Google Ads API and AdWords API Forum
    • Re: S... Matt Dworkin

Reply via email to