> 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

# GenerateBudgetRecommendation

# Package: googleAds

# Namespace: SuggestionsService

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

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

## Introduction

Retrieves a recommended budget for PERFORMANCE_MAX or PERFORMANCE_MAX_LEADS campaigns.
Uses the Google Ads recommendation API based on campaign configuration, location, and historical signals.

---

## REST API

### Schema

```
 Method: generateBudgetRecommendation
 Description: Retrieves a recommended budget for PERFORMANCE_MAX or PERFORMANCE_MAX_LEADS campaigns. Uses the Google Ads recommendation API based on campaign configuration, location, and historical signals.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/budget-recommendation
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignType, assetGroupInfo, currency
 Method parameters: 
   param name: adGroupInfo | type: array<adGroupInfo> | description: Optional. Ad group information containing keywords used as additional context for the recommendation.  | validation: maxItems 10
              - name: keywords | type: array<string> | description: Optional. Keywords associated with the ad group, used as additional context for the recommendation.  | validation: maxItems 100, maxLength 1000
   param name: assetGroupInfo | type: array<assetGroupInfo> | description: Required. Asset group information for the campaign. At least one entry with a `finalUrl` is required. | required: true | validation: maxItems 10
              - name: finalUrl | type: string | description: Required. Final landing page URL of the asset group.  | validation: format WEB_URL
              - name: headlines | type: array<string> | description: Optional. Short headline text assets associated with the asset group.  | validation: maxItems 15, maxLength 1000
              - name: descriptions | type: array<string> | description: Optional. Description text assets associated with the asset group.  | validation: maxItems 5, maxLength 1000
   param name: campaignCallAssetCount | type: campaignCallAssetCount | description: Optional. Number of call assets currently in the campaign.  | validation: format int32
   param name: campaignImageAssetCount | type: campaignImageAssetCount | description: Optional. Number of image assets currently in the campaign.  | validation: format int32
   param name: campaignType | type: CampaignType   | required: true 
      - enum:
           UNKNOWN - Unknown campaign type.
           SMART - Simplified auto-managed campaign. Google handles bidding and ad delivery based on keyword themes and geo targets.
           PERFORMANCE_MAX - Goal-based campaign that runs across all Google channels (Search, Display, YouTube, etc.) using asset groups.
           PERFORMANCE_MAX_LEADS - Performance Max variant optimized for lead generation, such as phone calls and form fills.
   param name: countryCodes | type: array<countryCodes> | description: Optional. ISO 3166-1 alpha-2 country codes for the campaign's target locations.  | validation: maxItems 50, maxLength 10
   param name: currency | type: currency | description: Required. ISO 4217 currency code for the recommendation (for example, "USD" or "EUR"). | required: true | validation: maxLength 10
   param name: currentBudgetMicros | type: currentBudgetMicros | description: Optional. Current campaign budget in micros (1,000,000 micros = 1 currency unit), used as additional context for the recommendation.  | validation: format int64
   param name: isNewCustomer | type: isNewCustomer | description: Optional. Whether the account has no existing campaigns. When true, a dedicated new-customer recommendation model is used.  
   param name: languageCodes | type: array<languageCodes> | description: Optional. ISO 639-1 language codes for the campaign's target languages.  | validation: maxItems 50, maxLength 10
   param name: merchantCenterAccountId | type: merchantCenterAccountId | description: Optional. Google Merchant Center account GUID for Performance Max retail campaigns.  | validation: format int64
   param name: negativeLocationIds | type: array<negativeLocationIds> | description: Optional. Google Ads geo target location GUIDs to exclude from targeting.  | validation: maxItems 1000
   param name: positiveLocationIds | type: array<positiveLocationIds> | description: Optional. Google Ads geo target location GUIDs to include in targeting.  | validation: maxItems 1000
   param name: targetContentNetwork | type: targetContentNetwork | description: Optional. Whether the campaign serves ads on the Google Display Network.  
   param name: targetPartnerSearchNetwork | type: targetPartnerSearchNetwork | description: Optional. Whether the campaign serves ads on the Google Search Partner network.  
 Return type: GenerateBudgetRecommendationResponse
  - name: budgetRecommendation | type: BudgetRecommendation | description: The generated budget recommendation. Absent when insufficient data is available to produce a recommendation.  
     - name: currentBudgetAmountMicros | type: string | description: Current campaign budget in micros, echoed from the request when provided.  | validation: format int64
     - name: recommendedBudgetAmountMicros | type: string | description: Google Ads recommended budget amount in micros (1,000,000 micros = 1 currency unit).  
     - name: budgetOptions | type: array<BudgetOption> | description: Alternative budget options with estimated performance impact for each.  | validation: maxItems 10
        - name: budgetAmountMicros | type: string | description: Budget amount in micros (1,000,000 micros = 1 currency unit).  
        - name: impact | type: BudgetRecommendationImpact | description: Estimated impact of choosing this budget amount compared to the current budget.  
           - name: baseMetrics | type: BudgetRecommendationMetrics | description: Estimated performance metrics at the current budget level.  
              - 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 metrics if the budget option is applied.  
     - name: impact | type: BudgetRecommendationImpact | description: Estimated performance impact of adopting the recommended budget.  


```

### Examples

### Generate Budget Recommendation
```curl
curl -X POST \
  'https://www.wixapis.com/google-ads/v1/budget-recommendation' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "campaignType": "PERFORMANCE_MAX",
    "assetGroupInfo": [
      {
        "finalUrl": "https://www.example.com",
        "headlines": ["Fresh Baked Every Morning", "Award-Winning Pastries"],
        "descriptions": ["Artisan breads and custom cakes baked fresh daily."]
      }
    ],
    "currency": "USD",
    "countryCodes": ["US"],
    "languageCodes": ["en"]
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.suggestions.generateBudgetRecommendation(campaignType, options)
 Description: Retrieves a recommended budget for PERFORMANCE_MAX or PERFORMANCE_MAX_LEADS campaigns. Uses the Google Ads recommendation API based on campaign configuration, location, and historical signals.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignType, options.assetGroupInfo, options.currency, options
 Method parameters: 
   param name: campaignType | type: CampaignType   | required: true 
      - enum:
           UNKNOWN - Unknown campaign type.
           SMART - Simplified auto-managed campaign. Google handles bidding and ad delivery based on keyword themes and geo targets.
           PERFORMANCE_MAX - Goal-based campaign that runs across all Google channels (Search, Display, YouTube, etc.) using asset groups.
           PERFORMANCE_MAX_LEADS - Performance Max variant optimized for lead generation, such as phone calls and form fills.
   param name: options | type: GenerateBudgetRecommendationOptions  none | required: true 
        - name: assetGroupInfo | type: array<BudgetRecommendationAssetGroupInfo> | description: Required. Asset group information for the campaign. At least one entry with a `finalUrl` is required. | required: true | validation: maxItems 10
           - name: finalUrl | type: string | description: Required. Final landing page URL of the asset group.  | validation: format WEB_URL
           - name: headlines | type: array<string> | description: Optional. Short headline text assets associated with the asset group.  | validation: maxItems 15, maxLength 1000
           - name: descriptions | type: array<string> | description: Optional. Description text assets associated with the asset group.  | validation: maxItems 5, maxLength 1000
        - name: adGroupInfo | type: array<BudgetRecommendationAdGroupInfo> | description: Optional. Ad group information containing keywords used as additional context for the recommendation.  | validation: maxItems 10
           - name: keywords | type: array<string> | description: Optional. Keywords associated with the ad group, used as additional context for the recommendation.  | validation: maxItems 100, maxLength 1000
        - name: isNewCustomer | type: boolean | description: Optional. Whether the account has no existing campaigns. When true, a dedicated new-customer recommendation model is used.  
        - name: currentBudgetMicros | type: string | description: Optional. Current campaign budget in micros (1,000,000 micros = 1 currency unit), used as additional context for the recommendation.  | validation: format int64
        - name: merchantCenterAccountId | type: string | description: Optional. Google Merchant Center account GUID for Performance Max retail campaigns.  | validation: format int64
        - name: campaignImageAssetCount | type: integer | description: Optional. Number of image assets currently in the campaign.  | validation: format int32
        - name: campaignCallAssetCount | type: integer | description: Optional. Number of call assets currently in the campaign.  | validation: format int32
        - name: countryCodes | type: array<string> | description: Optional. ISO 3166-1 alpha-2 country codes for the campaign's target locations.  | validation: maxItems 50, maxLength 10
        - name: languageCodes | type: array<string> | description: Optional. ISO 639-1 language codes for the campaign's target languages.  | validation: maxItems 50, maxLength 10
        - name: positiveLocationIds | type: array<string> | description: Optional. Google Ads geo target location GUIDs to include in targeting.  | validation: maxItems 1000
        - name: negativeLocationIds | type: array<string> | description: Optional. Google Ads geo target location GUIDs to exclude from targeting.  | validation: maxItems 1000
        - name: targetPartnerSearchNetwork | type: boolean | description: Optional. Whether the campaign serves ads on the Google Search Partner network.  
        - name: targetContentNetwork | type: boolean | description: Optional. Whether the campaign serves ads on the Google Display Network.  
        - name: currency | type: string | description: Required. ISO 4217 currency code for the recommendation (for example, "USD" or "EUR"). | required: true | validation: maxLength 10
 Return type: PROMISE<GenerateBudgetRecommendationResponse>
  - name: budgetRecommendation | type: BudgetRecommendation | description: The generated budget recommendation. Absent when insufficient data is available to produce a recommendation.  
     - name: currentBudgetAmountMicros | type: string | description: Current campaign budget in micros, echoed from the request when provided.  | validation: format int64
     - name: recommendedBudgetAmountMicros | type: string | description: Google Ads recommended budget amount in micros (1,000,000 micros = 1 currency unit).  
     - name: budgetOptions | type: array<BudgetOption> | description: Alternative budget options with estimated performance impact for each.  | validation: maxItems 10
        - name: budgetAmountMicros | type: string | description: Budget amount in micros (1,000,000 micros = 1 currency unit).  
        - name: impact | type: BudgetRecommendationImpact | description: Estimated impact of choosing this budget amount compared to the current budget.  
           - name: baseMetrics | type: BudgetRecommendationMetrics | description: Estimated performance metrics at the current budget level.  
              - 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 metrics if the budget option is applied.  
     - name: impact | type: BudgetRecommendationImpact | description: Estimated performance impact of adopting the recommended budget.  


```

### Examples

### Generate a budget recommendation for a Performance Max campaign
```javascript
import { suggestions } from '@wix/promote-google-ads';

const response = await suggestions.generateBudgetRecommendation({
  campaignType: 'PERFORMANCE_MAX',
  assetGroupInfo: [
    {
      finalUrl: 'https://www.example.com',
      headlines: ['Fresh Baked Every Morning', 'Award-Winning Pastries'],
      descriptions: ['Artisan breads and custom cakes baked fresh daily.'],
    },
  ],
  currency: 'USD',
  countryCodes: ['US'],
  languageCodes: ['en'],
});

/* Promise resolves to:
 * {
 *   "budgetRecommendation": {
 *     "recommendedBudgetAmountMicros": "15000000",
 *     "budgetOptions": [
 *       {
 *         "budgetAmountMicros": "8000000",
 *         "impact": {
 *           "baseMetrics": { "impressions": 0, "clicks": 0, "costMicros": 0, "conversions": 0 },
 *           "potentialMetrics": { "impressions": 1200, "clicks": 35, "costMicros": 8000000, "conversions": 2 }
 *         }
 *       },
 *       {
 *         "budgetAmountMicros": "15000000",
 *         "impact": {
 *           "baseMetrics": { "impressions": 0, "clicks": 0, "costMicros": 0, "conversions": 0 },
 *           "potentialMetrics": { "impressions": 2800, "clicks": 78, "costMicros": 15000000, "conversions": 5 }
 *         }
 *       }
 *     ]
 *   }
 * }
 */

```

### generateBudgetRecommendation (self-hosted)
Self-hosted 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 generateBudgetRecommendation(campaignType,options) {
  const response = await myWixClient.suggestions.generateBudgetRecommendation(campaignType,options);
};
```

---