AI-generated Key Takeaways
-
Check the budget's
reference_count
before removing it to ensure noENABLED
orPAUSED
campaigns are using it. -
A
reference_count
greater than 0 indicates the budget is still in use byENABLED
orPAUSED
campaigns. -
You can find the reference count by querying
campaign_budget.reference_count
for a specific budget ID. -
To remove an unused budget, send a
remove
operation with the campaign budget's resource name. -
Removing a campaign also removes any non-shared budget used by that campaign.
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've determined that a CampaignBudget
is no longer used and can be removed, send a
remove
operation with the resource name of the campaign budget.
When removing a campaign, you're also removing any non-shared budget being used by that campaign.