Sharing Campaign Budgets

A budget can be applied to a single campaign, or be shared across many campaigns.


When you create a new CampaignBudget using the Google Ads API, you can specify if it is shareable with the BoolValue of the explicitly_shared field:

  • true (default): can be shared among multiple campaigns
  • false: can be used by only one campaign

Explicitly shared budgets appear in an account's Shared Library in the Google Ads UI, whereas a non-shared budget appears only within its associated campaign's Settings.

In the following example where a new budget is created, the budget is shared because explicitly_shared is set to true.


private String createSharedCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) {
  try (CampaignBudgetServiceClient campaignBudgetServiceClient =
      googleAdsClient.getLatestVersion().createCampaignBudgetServiceClient()) {
    // Creates a shared budget.
    CampaignBudget budget =
            .setName("Shared Interplanetary Budget #" + getPrintableDateTime())
    // Constructs an operation that will create a shared budget.
    CampaignBudgetOperation operation =
    // Sends the operation in a mutate request.
    MutateCampaignBudgetsResponse response =
            Long.toString(customerId), Lists.newArrayList(operation));

    MutateCampaignBudgetResult mutateCampaignBudgetResult = response.getResults(0);
    // Prints the resource name of the created object.
        "Created shared budget with resource name: '%s'.%n",

    return mutateCampaignBudgetResult.getResourceName();


private string CreateSharedBudget(GoogleAdsClient client, long customerId, string name,
    long amount)
    // Get the CampaignBudgetService.
    CampaignBudgetServiceClient campaignBudgetService =

    // Create a shared budget.
    CampaignBudget budget = new CampaignBudget()
        Name = name,
        AmountMicros = amount,
        DeliveryMethod = BudgetDeliveryMethodEnum.Types.BudgetDeliveryMethod.Standard,
        ExplicitlyShared = true

    // Create the operation.
    CampaignBudgetOperation campaignBudgetOperation = new CampaignBudgetOperation()
        Create = budget

    // Make the mutate request.
    MutateCampaignBudgetsResponse retVal = campaignBudgetService.MutateCampaignBudgets(
        customerId.ToString(), new CampaignBudgetOperation[] { campaignBudgetOperation });
    return retVal.Results[0].ResourceName;


private static function createSharedCampaignBudget(
    GoogleAdsClient $googleAdsClient,
    int $customerId
) {
    // Creates a shared budget.
    $budget = new CampaignBudget([
        'name' => 'Shared Interplanetary Budget #' . Helper::getPrintableDatetime(),
        'delivery_method' => BudgetDeliveryMethod::STANDARD,
        // Sets the amount of budget.
        'amount_micros' => 50000000,
        // Makes the budget explicitly shared.
        'explicitly_shared' => true

    // Constructs a campaign budget operation.
    $campaignBudgetOperation = new CampaignBudgetOperation();

    // Issues a mutate request to create the budget.
    $campaignBudgetServiceClient = $googleAdsClient->getCampaignBudgetServiceClient();
    $response = $campaignBudgetServiceClient->mutateCampaignBudgets(
        MutateCampaignBudgetsRequest::build($customerId, [$campaignBudgetOperation])

    /** @var CampaignBudget $addedBudget */
    $addedBudget = $response->getResults()[0];
        "Created a shared budget with resource name '%s'.%s",

    return $addedBudget->getResourceName();


# Create a budget, which can be shared by multiple campaigns.
campaign_budget_operation = client.get_type("CampaignBudgetOperation")
campaign_budget = campaign_budget_operation.create = f"Interplanetary Budget {uuid.uuid4()}"
campaign_budget.delivery_method = (
campaign_budget.amount_micros = 500000
campaign_budget.explicitly_shared = True

# Add budget.
    campaign_budget_response = (
            customer_id=customer_id, operations=[campaign_budget_operation]
    campaign_budget_id = campaign_budget_response.results[0].resource_name
    print(f'Budget "{campaign_budget_id}" was created.')
except GoogleAdsException as ex:


# Create a budget, which can be shared by multiple campaigns.
budget = client.resource.campaign_budget do |cb| = "Interplanetary budget ##{( * 1000).to_i}"
  cb.amount_micros = 50_000_000
  cb.delivery_method = :STANDARD
  cb.explicitly_shared = true

operation = client.operation.create_resource.campaign_budget(budget)

response = client.service.campaign_budget.mutate_campaign_budgets(
  customer_id: customer_id,
  operations: [operation],
budget_id = response.results.first.resource_name


sub create_shared_campaign_buget {
  my ($api_client, $customer_id) = @_;

  # Create a shared budget.
  my $campaign_budget =
      name           => "Shared Interplanetary Budget #" . uniqid(),
      deliveryMethod => STANDARD,
      # Set the amount of budget.
      amountMicros => 50000000,
      # Makes the budget explicitly shared.
      explicitlyShared => 'true'

  # Create a campaign budget operation.
  my $campaign_budget_operation =
    ->new({create => $campaign_budget});

  # Add the campaign budget.
  my $campaign_budgets_response = $api_client->CampaignBudgetService()->mutate({
      customerId => $customer_id,
      operations => [$campaign_budget_operation]});

  my $campaign_budget_resource_name =

  printf "Created a shared budget with resource name: '%s'.\n",

  return $campaign_budget_resource_name;

Determine if a campaign budget is shared

You can retrieve the budget setting value by searching for the campaign_budget.explicitly_shared field. Here is the GAQL query for the field, filtering on a budget ID:

SELECT campaign_budget.explicitly_shared
FROM campaign_budget
WHERE = campaign_budget_id