Like campaigns, a budget cannot be completely deleted—you can only
set its status
field to REMOVED
.
Before removing a budget, ensure that no ENABLED
or PAUSED
campaigns are
using it by checking its
reference_count
.
If this field is greater than 0, there are ENABLED
or PAUSED
campaigns still
using the budget. You can retrieve this information by searching for metrics
with campaign_budget
as the main resource. Here is the GAQL query for the
reference count of a budget, filtering on its ID:
SELECT campaign_budget.reference_count FROM campaign_budget WHERE campaign_budget.id = campaign_budget_id
Once you determine that a CampaignBudget
is no longer used, in a
CampaignBudgetOperation.update
set the CampaignBudget
object with:
resource_name
field set to the resource name of the campaign budgetstatus
field set toREMOVED
Additionally, you can remove a non-shared budget being used by a single campaign by removing that campaign.