> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetRecommendations

# Package: googleAds

# Namespace: SuggestionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-suggestion-v1/get-recommendations.md

## Permission Scopes:
View google ads campaigns: SCOPE.PROMOTE.VIEW-GOOGLE-ADS

## Introduction

Retrieves Google Ads recommendations for the site's Google Ads account.

Google Ads generates recommendations from an account's settings and recent performance, such as
raising a campaign's budget, adding assets, or fixing Merchant Center issues. Google Ads
regenerates recommendations regularly, so results can change between calls.

Returns account-level recommendations and recommendations for each of the account's campaigns.
To retrieve only the recommendations for one campaign, specify `campaignId`.

The site must have a Google Ads account. To create one, call
[Create Account](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-account-v1/create-account.md).

---

## REST API

### Schema

```
 Method: getRecommendations
 Description: Retrieves Google Ads recommendations for the site's Google Ads account.  Google Ads generates recommendations from an account's settings and recent performance, such as raising a campaign's budget, adding assets, or fixing Merchant Center issues. Google Ads regenerates recommendations regularly, so results can change between calls.  Returns account-level recommendations and recommendations for each of the account's campaigns. To retrieve only the recommendations for one campaign, specify `campaignId`.  The site must have a Google Ads account. To create one, call [Create Account](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-account-v1/create-account.md).
 URL: https://www.wixapis.com/_serverless/pa-google/v1/recommendations
 Method: GET
 Method parameters:
   query param name: campaignId | type: campaignId | description: GUID of the campaign to retrieve recommendations for. When specified, only recommendations that apply to this campaign are returned, and account-level recommendations are excluded. When not specified, all recommendations are returned.  | validation: format GUID
 Return type: GetRecommendationsResponse
  - name: recommendations | type: array<Recommendation> | description: Retrieved recommendations, in no particular order. Max: 500 recommendations.  | validation: maxItems 500
     - name: type | type: string | description: Recommendation type, as defined by the Google Ads API. For example, `CAMPAIGN_BUDGET` or `SHOPPING_FIX_DISAPPROVED_PRODUCTS`.  For the full list of types, see [RecommendationType](https://developers.google.com/google-ads/api/reference/rpc/latest/RecommendationTypeEnum.RecommendationType) in the Google Ads API reference. Google Ads adds new types over time.  | validation: maxLength 100
     - name: campaignIds | type: array<string> | description: IDs of the campaigns the recommendation applies to. Empty for account-level recommendations. Max: 100 campaigns.  | validation: maxItems 100, format GUID
     - name: impact | type: BudgetRecommendationImpact | description: Estimated performance before and after applying the recommendation. Returned only when Google Ads provides an estimate.  
        - name: baseMetrics | type: BudgetRecommendationMetrics | description: Estimated performance with the current settings.  
           - name: impressions | type: number | description: Estimated number of ad impressions.  | validation: format double
           - name: clicks | type: number | description: Estimated number of clicks.  | validation: format double
           - name: costMicros | type: string | description: Estimated spend in micros (1,000,000 micros = 1 currency unit).  | validation: format int64
           - name: conversions | type: number | description: Estimated number of conversions.  | validation: format double
           - name: conversionsValue | type: number | description: Estimated total monetary value of all conversions, such as revenue from purchases or sign-ups.  | validation: format double
        - name: potentialMetrics | type: BudgetRecommendationMetrics | description: Estimated performance after the change.  
     - name: details | type: object | description: Type-specific details of the recommendation, in the Google Ads API JSON format: the value of the Google Ads `Recommendation` field for this type. For example, for `CAMPAIGN_BUDGET`, a [CampaignBudgetRecommendation](https://developers.google.com/google-ads/api/reference/rpc/latest/Recommendation.CampaignBudgetRecommendation) object. Google Ads defines the structure of this object, and it can change when Google Ads updates its API.  Amounts in micros (fields ending in `Micros`) are in the account's currency, where 1,000,000 micros equal 1 currency unit, and are returned as strings.  For `IMPROVE_PERFORMANCE_MAX_AD_STRENGTH`, also includes `assetCoverage`: the asset group's [AssetCoverage](https://developers.google.com/google-ads/api/reference/rpc/latest/AssetCoverage) object, which lists the asset field types and number of assets to add to improve its ad strength. `assetCoverage` is returned only when Google Ads provides it.  Returned only for types that have details.  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CAMPAIGN_NOT_FOUND | Description: Couldn't find the campaign.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACCOUNT_NOT_FOUND | Description: Couldn't find the site's Google Ads account.


```

### Examples

### Get recommendations for the account
Retrieves account-level recommendations and recommendations for each of the account's campaigns.

```curl
curl -X GET \
'https://www.wixapis.com/_serverless/pa-google/v1/recommendations' \
-H 'Authorization: <AUTH>'
```

### Get recommendations for a campaign
Retrieves only the recommendations that apply to the specified campaign.

```curl
curl -X GET \
'https://www.wixapis.com/_serverless/pa-google/v1/recommendations?campaignId=0b6c8f3e-2a41-4d7e-9c1a-5f2e8d4b7a10' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.suggestions.getRecommendations(options)
 Description: Retrieves Google Ads recommendations for the site's Google Ads account.  Google Ads generates recommendations from an account's settings and recent performance, such as raising a campaign's budget, adding assets, or fixing Merchant Center issues. Google Ads regenerates recommendations regularly, so results can change between calls.  Returns account-level recommendations and recommendations for each of the account's campaigns. To retrieve only the recommendations for one campaign, specify `campaignId`.  The site must have a Google Ads account. To create one, call [Create Account](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-account-v1/create-account.md).
 Method parameters:
   param name: options | type: GetRecommendationsOptions  none  
        - name: campaignId | type: string | description: GUID of the campaign to retrieve recommendations for. When specified, only recommendations that apply to this campaign are returned, and account-level recommendations are excluded. When not specified, all recommendations are returned.  | validation: format GUID
 Return type: PROMISE<GetRecommendationsResponse>
  - name: recommendations | type: array<Recommendation> | description: Retrieved recommendations, in no particular order. Max: 500 recommendations.  | validation: maxItems 500
     - name: type | type: string | description: Recommendation type, as defined by the Google Ads API. For example, `CAMPAIGN_BUDGET` or `SHOPPING_FIX_DISAPPROVED_PRODUCTS`.  For the full list of types, see [RecommendationType](https://developers.google.com/google-ads/api/reference/rpc/latest/RecommendationTypeEnum.RecommendationType) in the Google Ads API reference. Google Ads adds new types over time.  | validation: maxLength 100
     - name: campaignIds | type: array<string> | description: IDs of the campaigns the recommendation applies to. Empty for account-level recommendations. Max: 100 campaigns.  | validation: maxItems 100, format GUID
     - name: impact | type: BudgetRecommendationImpact | description: Estimated performance before and after applying the recommendation. Returned only when Google Ads provides an estimate.  
        - name: baseMetrics | type: BudgetRecommendationMetrics | description: Estimated performance with the current settings.  
           - name: impressions | type: number | description: Estimated number of ad impressions.  
           - name: clicks | type: number | description: Estimated number of clicks.  
           - name: costMicros | type: string | description: Estimated spend in micros (1,000,000 micros = 1 currency unit).  | validation: format int64
           - name: conversions | type: number | description: Estimated number of conversions.  
           - name: conversionsValue | type: number | description: Estimated total monetary value of all conversions, such as revenue from purchases or sign-ups.  
        - name: potentialMetrics | type: BudgetRecommendationMetrics | description: Estimated performance after the change.  
     - name: details | type: object | description: Type-specific details of the recommendation, in the Google Ads API JSON format: the value of the Google Ads `Recommendation` field for this type. For example, for `CAMPAIGN_BUDGET`, a [CampaignBudgetRecommendation](https://developers.google.com/google-ads/api/reference/rpc/latest/Recommendation.CampaignBudgetRecommendation) object. Google Ads defines the structure of this object, and it can change when Google Ads updates its API.  Amounts in micros (fields ending in `Micros`) are in the account's currency, where 1,000,000 micros equal 1 currency unit, and are returned as strings.  For `IMPROVE_PERFORMANCE_MAX_AD_STRENGTH`, also includes `assetCoverage`: the asset group's [AssetCoverage](https://developers.google.com/google-ads/api/reference/rpc/latest/AssetCoverage) object, which lists the asset field types and number of assets to add to improve its ad strength. `assetCoverage` is returned only when Google Ads provides it.  Returned only for types that have details.  

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CAMPAIGN_NOT_FOUND | Description: Couldn't find the campaign.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ACCOUNT_NOT_FOUND | Description: Couldn't find the site's Google Ads account.


```

### Examples

### Get Google Ads recommendations for a campaign
```javascript
import { suggestions } from "@wix/promote-google-ads";

async function getRecommendations() {
  const response = await suggestions.getRecommendations({
    campaignId: "0b6c8f3e-2a41-4d7e-9c1a-5f2e8d4b7a10",
  });
}

/* Promise resolves to:
 * {
 *   "recommendations": [
 *     {
 *       "type": "SITELINK_ASSET",
 *       "campaignIds": [
 *         "0b6c8f3e-2a41-4d7e-9c1a-5f2e8d4b7a10"
 *       ]
 *     },
 *     {
 *       "type": "SHOPPING_FIX_SUSPENDED_MERCHANT_CENTER_ACCOUNT",
 *       "campaignIds": [
 *         "0b6c8f3e-2a41-4d7e-9c1a-5f2e8d4b7a10",
 *         "5d1e7a2c-8b34-4f90-a6e1-3c9b2f7d4e85"
 *       ],
 *       "details": {
 *         "merchant": {
 *           "id": "123456789",
 *           "name": "Example Store"
 *         },
 *         "feedLabel": "US"
 *       }
 *     }
 *   ]
 * }
 */

```

### getRecommendations (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { suggestions } from '@wix/promote-google-ads';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { suggestions },
  // Include the auth strategy and host as relevant
});


async function getRecommendations(options) {
  const response = await myWixClient.suggestions.getRecommendations(options);
};
```

---