[Campaign goals](https://support.google.com/google-ads/answer/9143218) let you optimize specific campaigns for
specific conversion actions. If you have campaigns with goals that differ from
your account-level goals, you can modify each
[`CampaignConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoal) and its `biddable` setting
as needed using [`CampaignConversionGoalService`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoalService). For example, if
your account generally optimizes for ecommerce but you have one campaign
targeting store visits, you could set `biddable=true` for all
`CampaignConversionGoal` objects with `category=STORE_VISIT`, and
`biddable=false` for all other `CampaignConversionGoal` objects.

When you override the customer-level goals for a campaign by issuing a
[`CampaignConversionGoalOperation`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoalOperation) or using a
[custom goal](https://developers.google.com/google-ads/api/docs/conversions/goals/campaign-goals#custom_goals), Google Ads will no longer apply future
`CustomerConversionGoal` changes to *any* of the campaign's
`CampaignConversionGoal` objects. The `CampaignConversionGoal` objects are
completely independent from that point forward, and will remain so unless you
transition the campaign back to using customer-level goals by updating its
conversion goal campaign configuration as described in
[Goal configuration level](https://developers.google.com/google-ads/api/docs/conversions/goals/campaign-goals#goal_configuration_level).

## Campaign goals for new conversion actions

As with [`CustomerConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomerConversionGoal), whenever a
[`ConversionAction`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionAction) is added to the Google Ads conversion
customer with a new [`category`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionAction#category) and [`origin`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionAction#origin)
combination, Google Ads automatically creates a new
[`CampaignConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoal) for that combination.
The `biddable` attribute of the campaign goal is `true` unless either of the
following conditions is met, in which case `biddable` is `false`:

- Any other `CampaignConversionGoal` for the campaign and the new action's
  `category` has `biddable` set to `false`.

- The `category` and `origin` combination is in the following table.

| [Conversion Action Category](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionActionCategoryEnum.ConversionActionCategory) | [Conversion Origin](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionOriginEnum.ConversionOrigin) |
|---|---|
| `BEGIN_CHECKOUT` | `GOOGLE_HOSTED` |
| `CONSIDERATION` | `GOOGLE_HOSTED` |
| `CONTACT` | `GOOGLE_HOSTED` |
| `CONVERTED_LEAD` | `GOOGLE_HOSTED` |
| `ENGAGEMENT` | `GOOGLE_HOSTED` |
| `GET_DIRECTIONS` | `GOOGLE_HOSTED` |
| `PAGE_VIEW` | `GOOGLE_HOSTED` |
| `QUALIFIED_LEAD` | `GOOGLE_HOSTED` |
| `SIGNUP` | `GOOGLE_HOSTED` |
| `PURCHASE` | `GOOGLE_HOSTED` |
| `STORE_SALE` | `STORE` |
| `STORE_VISIT` | `STORE` |
| `PHONE_CALL_LEAD` | `LOCAL_SERVICES_ADS` |
| `MESSAGE_LEAD` | `LOCAL_SERVICES_ADS` |
| `BOOK_APPOINTMENT` | `LOCAL_SERVICES_ADS` |
| `CONVERTED_LEAD` | `LOCAL_SERVICES_ADS` |

## Retrieve campaign goals

Use the following query to retrieve the list of `CampaignConversionGoals`
for your account. For convenience, you can include attributes of `campaign`
in the `SELECT` clause, or use them in the `WHERE` clause to only retrieve the
campaign goals for specific campaigns. The following query shows how to filter
by `campaign.advertising_channel_type` as an example, but you could also filter
by other campaign attributes such as `campaign.id` or `campaign.name`.

    SELECT
      campaign_conversion_goal.campaign,
      campaign_conversion_goal.category,
      campaign_conversion_goal.origin,
      campaign_conversion_goal.biddable,
      campaign.id,
      campaign.name
    FROM campaign_conversion_goal
    WHERE campaign.advertising_channel_type = 'PERFORMANCE_MAX'

## Goal configuration level

The [`goal_config_level`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfig#goal_config_level) of `ConversionGoalCampaignConfig`
indicates the source of goals for a campaign. Campaigns with `goal_config_level`
of [`CUSTOMER`](https://developers.google.com/google-ads/api/reference/rpc/v26/GoalConfigLevelEnum.GoalConfigLevel#customer) are using customer-level goals, while campaigns
with `goal_config_level` of [`CAMPAIGN`](https://developers.google.com/google-ads/api/reference/rpc/v26/GoalConfigLevelEnum.GoalConfigLevel#campaign) are using campaign-level
goals.

Updating any of the `CampaignConversionGoals` of a campaign or using a
[custom goal](https://developers.google.com/google-ads/api/docs/conversions/goals/campaign-goals#custom_goals) automatically changes the campaign's
[`ConversionGoalCampaignConfig`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfig) to have `goal_config_level=CAMPAIGN`. You
can revert all campaign-specific goal settings for a campaign and transition it
back to using customer-level goals by setting the `goal_config_level` to
`CUSTOMER` using [`ConversionGoalCampaignConfigService`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfigService).

Use the following query to retrieve the `goal_config_level` for each campaign.

    SELECT
      conversion_goal_campaign_config.campaign,
      conversion_goal_campaign_config.custom_conversion_goal,
      conversion_goal_campaign_config.goal_config_level,
      campaign.id,
      campaign.name
    FROM conversion_goal_campaign_config

## Custom goals

Both [`CustomerConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomerConversionGoal) and
[`CampaignConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CampaignConversionGoal) express goals based on
combinations of `category` and `origin`. [Custom goals](https://support.google.com/google-ads/answer/9143218#custom_goals) provide
the additional flexibility of optimizing for specific conversion actions,
regardless of `origin` or `category`.

One scenario where this is useful is if you want to set a goal based on a subset
of goals for the same `category` and `origin`. For example, you might have three
conversion actions with `category=DEFAULT` and `origin=WEBSITE`, but on one
particular campaign, you only want to bid based on two of those conversion
actions. In this scenario, you could have the campaign use a custom goal that
only includes those two conversion actions, and set `biddable=false` on the
`CampaignConversionGoal` for `category=DEFAULT` and `origin=WEBSITE`.

The steps for creating and applying a custom goal to a campaign are as follows:

1. Create a [`CustomConversionGoal`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomConversionGoal) using
   [`CustomConversionGoalService`](https://developers.google.com/google-ads/api/reference/rpc/v26/CustomConversionGoalService). Set the
   `conversion_actions` repeated field to the list of `ConversionAction`
   resource names that Google Ads should use for optimization, and set the `name`
   to a name of your choosing.

   > [!IMPORTANT]
   > **Important:** You *must* create the `CustomConversionGoal` in the [Google Ads conversion customer](https://developers.google.com/google-ads/api/docs/conversions/getting-started#enable_conversion_tracking). Make sure you specify the Google Ads conversion customer's customer ID for the `customer_id` on your [`MutateCustomConversionGoalsRequest`](https://developers.google.com/google-ads/api/reference/rpc/v26/MutateCustomConversionGoalsRequest), and use credentials for a user who has access to the Google Ads conversion customer.

   > [!IMPORTANT]
   > **Key Point:** When a `ConversionAction` is included in a `CustomConversionGoal`, the custom goal will optimize for that conversion action regardless of whether the action's [`primary_for_goal`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionAction#primary_for_goal) setting is `true` or `false`.

2. Update the campaign's [`ConversionGoalCampaignConfig`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfig) using
   [`ConversionGoalCampaignConfigService`](https://developers.google.com/google-ads/api/reference/rpc/v26/ConversionGoalCampaignConfigService), setting the
   `custom_conversion_goal` to the resource name of the `CustomConversionGoal`
   from the previous step, and setting the operation's `update_mask` to
   `custom_conversion_goal` (the backend automatically updates
   `goal_config_level` to `CAMPAIGN`).

3. Update the `biddable` attribute of any `CampaignConversionGoal` as needed.
   For example, if you *only* want Google Ads to optimize for the conversion
   actions in the custom goal, set `biddable` to `false` on each
   `CampaignConversionGoal`. If you want Google Ads to optimize for the conversion
   actions in the custom goal *in addition to* conversion actions for specific
   combinations of `category` and `origin`, ensure that `biddable` is `true`
   for each corresponding `CampaignConversionGoal`, and `false` for each
   `CampaignConversionGoal` of other combinations of `origin` and `category`.

## Retrieving custom goals

Use the following query to retrieve all of the `CustomConversionGoal` resources
in your account. The response will include custom goals from the effective
conversion account if your account is using cross-account conversion tracking.

    SELECT
      custom_conversion_goal.id,
      custom_conversion_goal.name,
      custom_conversion_goal.status,
      custom_conversion_goal.conversion_actions
    FROM custom_conversion_goal

In addition, you can include attributes of `custom_conversion_goal` and
`campaign` when querying the `conversion_goal_campaign_config` resource. This
is useful for seeing how your campaigns, custom goals, and goal configurations
all relate to each other in a single response.

    SELECT
      conversion_goal_campaign_config.campaign,
      conversion_goal_campaign_config.custom_conversion_goal,
      conversion_goal_campaign_config.goal_config_level,
      campaign.id,
      campaign.name,
      custom_conversion_goal.name,
      custom_conversion_goal.status,
      custom_conversion_goal.conversion_actions
    FROM conversion_goal_campaign_config