> 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

# GetTextAssetSuggestions

# Package: googleAds

# Namespace: SuggestionsService

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

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

## Introduction

Retrieves AI-generated text assets (headlines, descriptions) for a Performance Max campaign.
Responses may take up to 60 seconds. `suggestionInfo.landingPageUrl` and
`textSuggestionInfo.languageCode` are required.

---

## REST API

### Schema

```
 Method: getTextAssetSuggestions
 Description: Retrieves AI-generated text assets (headlines, descriptions) for a Performance Max campaign. Responses may take up to 60 seconds. `suggestionInfo.landingPageUrl` and `textSuggestionInfo.languageCode` are required.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/text-asset-suggestions
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  suggestionInfo, suggestionInfo.landingPageUrl, textSuggestionInfo, textSuggestionInfo.languageCode
 Method parameters: 
   param name: suggestionInfo | type: AssetSuggestionInfo   | required: true 
        - name: landingPageUrl | type: string | description: Public URL of the campaign landing page, used to analyze content for asset generation. | required: true | validation: format WEB_URL
        - name: assetTypes | type: array<AssetFieldType> | description: Specific asset types to generate. Must correspond to the requested kind of asset (text or image). When omitted or empty, all supported types for the request are returned. Supported text types: HEADLINE, LONG_HEADLINE, DESCRIPTION. Supported image types: MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, LOGO.  | validation: maxItems 5
             - enum:
             -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
             -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
             -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
             -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
             -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
             -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
             -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
             -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
             -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
             -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
             -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
             -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
        - name: searchThemes | type: array<string> | description: Search themes used in the campaign's targeting, provided as context for more relevant suggestions.  | validation: maxItems 25, maxLength 1000
        - name: userPrompt | type: string | description: Optional free-form instructions for refining the generated asset content.  | validation: maxLength 1000
        - name: provider | type: AssetSuggestionProvider | description: Provider to use for asset generation. Defaults to GOOGLE with WIX as fallback.  
             - enum:
             -     GOOGLE: Google Ads Asset Generation API.
             -     WIX: Wix in-house asset generation (Runway AI for images).
   param name: textSuggestionInfo | type: TextSuggestionInfo   | required: true 
        - name: languageCode | type: string | description: ISO 639-1 two-letter language code specifying the language in which text assets should be generated. | required: true | validation: format LANGUAGE
        - name: excludeTexts | type: array<string> | description: Text strings to exclude from the generated suggestions, such as existing headlines or descriptions already in use.  | validation: maxItems 100, maxLength 1000
 Return type: GetTextAssetSuggestionsResponse
  - name: assetSuggestions | type: array<AssetSuggestion> | description: AI-generated text assets (headlines, long headlines, descriptions).  
     - ONE-OF: 
        - name: headlineAsset | type: HeadlineTextAsset | description: Short headline text asset (up to 30 characters).  
           - name: text | type: string | description: Headline text shown in the ad.  | validation: maxLength 30
        - name: longHeadlineAsset | type: LongHeadlineTextAsset | description: Long headline text asset (up to 90 characters).  
           - name: text | type: string | description: Long headline text shown in the ad.  | validation: maxLength 90
        - name: descriptionAsset | type: DescriptionTextAsset | description: Description text asset (up to 90 characters).  
           - name: text | type: string | description: Description text shown below the headline in the ad.  | validation: maxLength 90
        - name: businessNameAsset | type: BusinessNameTextAsset | description: Business name text asset (up to 25 characters).  
           - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
        - name: imageAsset | type: ImageAsset | description: Image asset uploaded to the site's Wix Media Manager.  
           - name: name | type: string | description: Display name for the image asset.  | validation: maxLength 1000
           - name: url | type: string | description: URL of the image served from Wix Media Manager.  | validation: format WEB_URL
     - name: assetType | type: AssetFieldType | description: The field type identifying how this asset is used within a Performance Max campaign.  
         - enum:
         -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
         -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
         -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
         -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
         -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
         -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
         -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
         -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ASSET_TYPE | Description: none


```

### Examples

### Get Text Asset Suggestions
```curl
curl -X POST \
  'https://www.wixapis.com/google-ads/v1/text-asset-suggestions' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "suggestionInfo": {
      "landingPageUrl": "https://www.example.com",
      "assetTypes": ["HEADLINE", "DESCRIPTION"]
    },
    "textSuggestionInfo": {
      "languageCode": "en"
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.suggestions.getTextAssetSuggestions(suggestionInfo, options)
 Description: Retrieves AI-generated text assets (headlines, descriptions) for a Performance Max campaign. Responses may take up to 60 seconds. `suggestionInfo.landingPageUrl` and `textSuggestionInfo.languageCode` are required.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  suggestionInfo, suggestionInfo.landingPageUrl, options.textSuggestionInfo, options.textSuggestionInfo.languageCode, options
 Method parameters: 
   param name: options | type: GetTextAssetSuggestionsOptions  none | required: true 
        - name: textSuggestionInfo | type: TextSuggestionInfo | description: Language and exclusion settings for text asset generation. | required: true 
           - name: languageCode | type: string | description: ISO 639-1 two-letter language code specifying the language in which text assets should be generated. | required: true | validation: format LANGUAGE
           - name: excludeTexts | type: array<string> | description: Text strings to exclude from the generated suggestions, such as existing headlines or descriptions already in use.  | validation: maxItems 100, maxLength 1000
   param name: suggestionInfo | type: AssetSuggestionInfo   | required: true 
        - name: landingPageUrl | type: string | description: Public URL of the campaign landing page, used to analyze content for asset generation. | required: true | validation: format WEB_URL
        - name: assetTypes | type: array<AssetFieldType> | description: Specific asset types to generate. Must correspond to the requested kind of asset (text or image). When omitted or empty, all supported types for the request are returned. Supported text types: HEADLINE, LONG_HEADLINE, DESCRIPTION. Supported image types: MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, LOGO.  | validation: maxItems 5
             - enum:
             -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
             -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
             -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
             -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
             -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
             -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
             -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
             -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
             -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
             -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
             -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
             -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
        - name: searchThemes | type: array<string> | description: Search themes used in the campaign's targeting, provided as context for more relevant suggestions.  | validation: maxItems 25, maxLength 1000
        - name: userPrompt | type: string | description: Optional free-form instructions for refining the generated asset content.  | validation: maxLength 1000
        - name: provider | type: AssetSuggestionProvider | description: Provider to use for asset generation. Defaults to GOOGLE with WIX as fallback.  
             - enum:
             -     GOOGLE: Google Ads Asset Generation API.
             -     WIX: Wix in-house asset generation (Runway AI for images).
 Return type: PROMISE<GetTextAssetSuggestionsResponse>
  - name: assetSuggestions | type: array<AssetSuggestion> | description: AI-generated text assets (headlines, long headlines, descriptions).  
     - ONE-OF: 
        - name: headlineAsset | type: HeadlineTextAsset | description: Short headline text asset (up to 30 characters).  
           - name: text | type: string | description: Headline text shown in the ad.  | validation: maxLength 30
        - name: longHeadlineAsset | type: LongHeadlineTextAsset | description: Long headline text asset (up to 90 characters).  
           - name: text | type: string | description: Long headline text shown in the ad.  | validation: maxLength 90
        - name: descriptionAsset | type: DescriptionTextAsset | description: Description text asset (up to 90 characters).  
           - name: text | type: string | description: Description text shown below the headline in the ad.  | validation: maxLength 90
        - name: businessNameAsset | type: BusinessNameTextAsset | description: Business name text asset (up to 25 characters).  
           - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
        - name: imageAsset | type: ImageAsset | description: Image asset uploaded to the site's Wix Media Manager.  
           - name: name | type: string | description: Display name for the image asset.  | validation: maxLength 1000
           - name: url | type: string | description: URL of the image served from Wix Media Manager.  | validation: format WEB_URL
     - name: assetType | type: AssetFieldType | description: The field type identifying how this asset is used within a Performance Max campaign.  
         - enum:
         -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
         -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
         -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
         -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
         -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
         -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
         -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
         -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_ASSET_TYPE | Description: none


```

### Examples

### Get text asset suggestions for a Performance Max campaign
```javascript
import { suggestions } from '@wix/promote-google-ads';

const response = await suggestions.getTextAssetSuggestions({
  suggestionInfo: {
    landingPageUrl: 'https://www.example.com',
    assetTypes: ['HEADLINE', 'DESCRIPTION'],
  },
  textSuggestionInfo: {
    languageCode: 'en',
  },
});

/* Promise resolves to:
 * {
 *   "assetSuggestions": [
 *     {
 *       "assetType": "HEADLINE",
 *       "headlineAsset": { "text": "Fresh Baked Every Morning" }
 *     },
 *     {
 *       "assetType": "HEADLINE",
 *       "headlineAsset": { "text": "Award-Winning Pastries" }
 *     },
 *     {
 *       "assetType": "DESCRIPTION",
 *       "descriptionAsset": { "text": "Visit us for artisan breads, custom cakes, and more." }
 *     }
 *   ]
 * }
 */

```

### getTextAssetSuggestions (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 getTextAssetSuggestions(suggestionInfo,options) {
  const response = await myWixClient.suggestions.getTextAssetSuggestions(suggestionInfo,options);
};
```

---