Unable to update budget and end_date for performance_max campaign

88 views
Skip to first unread message

Aromal S

unread,
Sep 12, 2024, 8:31:49 AM9/12/24
to Google Ads API and AdWords API Forum
Hi team,
I am trying to update the budget and end_date for performance_max campaign. I am able to update the end date through the API but unable to update the budget.
For other type of campaigns like search, app etc. I am able to update both. Could you please help
It shows below error
{
 "additional_error": "rpc error: code = InvalidArgument desc = Request contains an invalid argument.",
 "data": null,
 "error": [
  {
   "errors": [
    {
     "error_code": {
      "ErrorCode": {
       "FieldError": 3
      }
     },
     "message": "The field attempted to be mutated is immutable.",
     "trigger": {
      "Value": {
       "Int64Value": 13920971191
      }
     },
     "location": {
      "field_path_elements": [
       {
        "field_name": "operations",
        "index": 0
       },
       {
        "field_name": "update"
       },
       {
        "field_name": "campaign_budget"
       }
      ]
     }
    }
   ],
   "request_id": "n_llxOxy7ScUOlmQZ1UQTw"
  }
 ],
 "message": "Error While Extending The Campaign",
 "status": false
}

Google Ads API Forum Advisor

unread,
Sep 12, 2024, 12:49:12 PM9/12/24
to aro...@zocket.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Kindly note that, as this is a Performance Max (PMax) campaign that you are trying to update, according to the Google Ads API documentation for PMax Campaign Budgets, it states that "The budget cannot be shared".

Since you are attempting to set the campaign_budget field as a resource name, it implies that you are trying to set a shared budget onto the campaign. If you want to change the budget setting for this campaign, you'll need to modify the campaign.campaign_budget fields, as is illustrated in this documentation.

If you are still facing issues, even after following the given suggestion, please share the complete API logs (requestresponserequest-id and request header) generated on your device with us. 

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java.NetPHPPythonRuby or Perl to enable logging at your end. You can enable logging via the curl command by using the -i flag for REST interface requests.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vG4og:ref" (ADR-00267964)

Thanks,
 
Google Logo Google Ads API Team



 

girish jain

unread,
Sep 13, 2024, 3:59:15 AM9/13/24
to Google Ads API and AdWords API Forum
Hi team,
I am already using the explicitly shared variable as false. 
budget := googleCampaignsDataModel.Budget / (durationFloat + 1)
budgetInMicros := int64(budget) * int64(1000000)
budgetOperation := &servicespb.CampaignBudgetOperation{
Operation: &servicespb.CampaignBudgetOperation_Create{
Create: &resources.CampaignBudget{
Name: &budgetName,
DeliveryMethod: enums.BudgetDeliveryMethodEnum_BudgetDeliveryMethod(2),
AmountMicros: &budgetInMicros,
ExplicitlyShared: &varFalse,
},
},
}

and using the same campaign operation as mentioned in the doc
campaignOperation := &servicespb.CampaignOperation{
Operation: &servicespb.CampaignOperation_Create{
Create: &resources.Campaign{
Name: &campaignName,
AdvertisingChannelType: enums.AdvertisingChannelTypeEnum_AdvertisingChannelType(10), // PERFORMANCE_MAX
Status: enums.CampaignStatusEnum_PAUSED,
CampaignBudget: &budgetResourceName,
NetworkSettings: &resources.Campaign_NetworkSettings{
TargetGoogleSearch: &varTrue,
},
StartDate: &startDate,
EndDate: &endDate,
CampaignBiddingStrategy: &resources.Campaign_MaximizeConversions{},
},
},
}

girish jain

unread,
Sep 13, 2024, 5:42:11 AM9/13/24
to Google Ads API and AdWords API Forum
For updation , I am creating a new budget resource and then updating the campaign.campaign_budget with new budget resource.

Google Ads API Forum Advisor

unread,
Sep 13, 2024, 8:56:51 AM9/13/24
to giris...@zocket.com, adwor...@googlegroups.com
Hi,

I understand that you are trying to create a new campaign budget resource and trying to update it using the campaigns.mutate method in the Google Ads API. If you follow this approach you will encounter the IMMUTABLE_FIELD error. Instead, if you want to modify the campaign budget, I would suggest you to use the campaignBudgets.mutate method and modify your old campaign budget resource using the Google Ads API. 

If you prefer not to follow this approach, that's completely fine. I’m currently checking with the rest of our team regarding attaching the new campaign budget resource to the PMax campaign using the campaign operation. One of our colleagues will reach out to you once we have an update on this matter.
Reply all
Reply to author
Forward
0 new messages