Recommendations are automatically generated by Google Ads and provide ideas for
ways to optimize your account, such as by increasing campaign budget for a
limited campaign or by adding relevant keywords. See the full list of
recommendation types in the [Google Ads API documentation](https://developers.google.com/google-ads/api/docs/recommendations#types).

> [!WARNING]
> **Warning:** When applying recommended keywords from the add new keywords recommendation, advertisers are responsible for ensuring that their ads are compliant with advertising policies after keywords are inserted.

## Retrieve recommendations

To retrieve recommendations, use the [`AdsApp.recommendations()` selector](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_recommendationselector),
which works similarly to other selectors in letting you specify conditions on
what types of recommendations to return:

    const selector = AdsApp.recommendations()
      .withCondition('recommendation.type IN (CAMPAIGN_BUDGET)');
    const recommendations = selector.get();

## Apply recommendations

Once you've fetched the recommendations, apply them like so:

    for (const recommendation of recommendations) {
      // Perform whatever check here that works for your use case.
      // You can also potentially skip this step if you've sufficiently narrowed
      // down what recommendations you're selecting initially with customized
      // withCondition clauses in the previous step.
      if (shouldApply(recommendation)) {
        recommendation.apply();
      }
    }