> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetImageAssetSuggestions

# Package: googleAds

# Namespace: SuggestionsService

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

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

## Introduction

Retrieves AI-generated image assets for a Performance Max campaign.

The generated images are saved to the site's Media Manager, in the
"Google Ads AI generated images" folder.

The response can take up to 60 seconds.

---

## REST API

### Schema

```
 Method: getImageAssetSuggestions
 Description: Retrieves AI-generated image assets for a Performance Max campaign.  The generated images are saved to the site's Media Manager, in the "Google Ads AI generated images" folder.  The response can take up to 60 seconds.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/image-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
 Method parameters: 
   param name: imageSuggestionInfo | type: ImageSuggestionInfo    
        - name: adContent | type: PerformanceMaxAdContent | description: Campaign's text assets, used as context for generating the images.  
           - name: headlines | type: array<HeadlineTextAsset> | description: Headlines.  | validation: maxItems 100
              - name: text | type: string | description: Headline text shown in the ad.  | validation: maxLength 30
           - name: longHeadlines | type: array<LongHeadlineTextAsset> | description: Long headlines.  | validation: maxItems 100
              - name: text | type: string | description: Long headline text shown in the ad.  | validation: maxLength 90
           - name: descriptions | type: array<DescriptionTextAsset> | description: Descriptions.  | validation: maxItems 100
              - name: text | type: string | description: Description text shown below the headline in the ad.  | validation: maxLength 90
           - name: businessName | type: BusinessNameTextAsset | description: Business name.  
              - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
   param name: suggestionInfo | type: AssetSuggestionInfo   | required: true 
        - name: landingPageUrl | type: string | description: URL of the campaign's landing page. Its content is used to generate the assets. | required: true | validation: format WEB_URL
        - name: assetTypes | type: array<AssetFieldType> | description: Types of assets to generate. Specify text asset types when retrieving text asset suggestions, and image asset types when retrieving image asset suggestions.  Supported text asset types: `HEADLINE`, `LONG_HEADLINE`, `DESCRIPTION`.  Supported image asset types: `MARKETING_IMAGE`, `SQUARE_MARKETING_IMAGE`, `LOGO`.  Default: All supported types of the requested kind.  | 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). Minimum 600x314. Multiple images allowed.
             -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 300x300. Multiple images allowed.
             -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 128x128. A transparent background is recommended.
             -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Minimum 480x600. Multiple images allowed.
             -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300). Minimum 512x128.
        - name: searchThemes | type: array<string> | description: Search themes the campaign targets, used as context for more relevant suggestions.  | validation: maxItems 25, maxLength 1000
        - name: userPrompt | type: string | description: Free-form instructions for the generated assets. For example, `Highlight free delivery`.  | validation: maxLength 1000
        - name: provider | type: AssetSuggestionProvider | description: Provider that generates the assets.  
             - enum:
             -     GOOGLE: Google Ads generates the assets.
             -     WIX: Wix generates the assets with AI.
 Return type: GetImageAssetSuggestionsResponse
  - name: assetSuggestions | type: array<AssetSuggestion> | description: Generated image assets. The images are saved to the site's Media Manager.  
     - ONE-OF: 
        - name: headlineAsset | type: HeadlineTextAsset | description: Headline, 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, 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, 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, up to 25 characters.  
           - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
        - name: imageAsset | type: ImageAsset | description: Image saved to the site's 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: How the asset is used in a Performance Max campaign. For example, `HEADLINE` or `MARKETING_IMAGE`.  
         - 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). Minimum 600x314. Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 300x300. Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 128x128. A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Minimum 480x600. Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300). Minimum 512x128.


```

### Examples

### Get marketing image suggestions
```curl
curl -X POST \
'https://www.wixapis.com/_serverless/pa-google/v1/image-asset-suggestions' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "suggestionInfo": {
    "landingPageUrl": "https://www.sunrisebakery.com",
    "assetTypes": ["MARKETING_IMAGE", "SQUARE_MARKETING_IMAGE"]
  },
  "imageSuggestionInfo": {
    "adContent": {
      "headlines": [
        { "text": "Fresh Baked Every Morning" }
      ],
      "descriptions": [
        { "text": "Visit us for artisan breads, custom cakes, and more." }
      ],
      "businessName": {
        "text": "Sunrise Bakery"
      }
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.suggestions.getImageAssetSuggestions(suggestionInfo, options)
 Description: Retrieves AI-generated image assets for a Performance Max campaign.  The generated images are saved to the site's Media Manager, in the "Google Ads AI generated images" folder.  The response can take up to 60 seconds.
 # 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
 Method parameters: 
   param name: suggestionInfo | type: AssetSuggestionInfo   | required: true 
        - name: landingPageUrl | type: string | description: URL of the campaign's landing page. Its content is used to generate the assets. | required: true | validation: format WEB_URL
        - name: assetTypes | type: array<AssetFieldType> | description: Types of assets to generate. Specify text asset types when retrieving text asset suggestions, and image asset types when retrieving image asset suggestions.  Supported text asset types: `HEADLINE`, `LONG_HEADLINE`, `DESCRIPTION`.  Supported image asset types: `MARKETING_IMAGE`, `SQUARE_MARKETING_IMAGE`, `LOGO`.  Default: All supported types of the requested kind.  | 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). Minimum 600x314. Multiple images allowed.
             -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 300x300. Multiple images allowed.
             -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 128x128. A transparent background is recommended.
             -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Minimum 480x600. Multiple images allowed.
             -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300). Minimum 512x128.
        - name: searchThemes | type: array<string> | description: Search themes the campaign targets, used as context for more relevant suggestions.  | validation: maxItems 25, maxLength 1000
        - name: userPrompt | type: string | description: Free-form instructions for the generated assets. For example, `Highlight free delivery`.  | validation: maxLength 1000
        - name: provider | type: AssetSuggestionProvider | description: Provider that generates the assets.  
             - enum:
             -     GOOGLE: Google Ads generates the assets.
             -     WIX: Wix generates the assets with AI.
   param name: options | type: GetImageAssetSuggestionsOptions  none  
        - name: imageSuggestionInfo | type: ImageSuggestionInfo | description: Campaign's text assets, used as context for generating the images.  
           - name: adContent | type: PerformanceMaxAdContent | description: Campaign's text assets, used as context for generating the images.  
              - name: headlines | type: array<HeadlineTextAsset> | description: Headlines.  | validation: maxItems 100
                 - name: text | type: string | description: Headline text shown in the ad.  | validation: maxLength 30
              - name: longHeadlines | type: array<LongHeadlineTextAsset> | description: Long headlines.  | validation: maxItems 100
                 - name: text | type: string | description: Long headline text shown in the ad.  | validation: maxLength 90
              - name: descriptions | type: array<DescriptionTextAsset> | description: Descriptions.  | validation: maxItems 100
                 - name: text | type: string | description: Description text shown below the headline in the ad.  | validation: maxLength 90
              - name: businessName | type: BusinessNameTextAsset | description: Business name.  
                 - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
 Return type: PROMISE<GetImageAssetSuggestionsResponse>
  - name: assetSuggestions | type: array<AssetSuggestion> | description: Generated image assets. The images are saved to the site's Media Manager.  
     - ONE-OF: 
        - name: headlineAsset | type: HeadlineTextAsset | description: Headline, 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, 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, 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, up to 25 characters.  
           - name: text | type: string | description: Business name shown in the ad.  | validation: maxLength 25
        - name: imageAsset | type: ImageAsset | description: Image saved to the site's 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: How the asset is used in a Performance Max campaign. For example, `HEADLINE` or `MARKETING_IMAGE`.  
         - 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). Minimum 600x314. Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 300x300. Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). Minimum 128x128. A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Minimum 480x600. Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300). Minimum 512x128.


```

### Examples

### Get marketing image suggestions
```javascript
import { suggestions } from "@wix/promote-google-ads";

async function getImageAssetSuggestions() {
  const response = await suggestions.getImageAssetSuggestions(
    {
      landingPageUrl: "https://www.sunrisebakery.com",
      assetTypes: ["MARKETING_IMAGE", "SQUARE_MARKETING_IMAGE"],
    },
    {
      imageSuggestionInfo: {
        adContent: {
          headlines: [{ text: "Fresh Baked Every Morning" }],
          descriptions: [
            { text: "Visit us for artisan breads, custom cakes, and more." },
          ],
          businessName: { text: "Sunrise Bakery" },
        },
      },
    },
  );
}

/* Promise resolves to:
 * {
 *   "assetSuggestions": [
 *     {
 *       "assetType": "MARKETING_IMAGE",
 *       "imageAsset": {
 *         "url": "https://static.wixstatic.com/media/7c3e9a_4b8d2f1e6a9c4d7b8e2f5a1c3d6b9e0f~mv2.png"
 *       }
 *     },
 *     {
 *       "assetType": "SQUARE_MARKETING_IMAGE",
 *       "imageAsset": {
 *         "url": "https://static.wixstatic.com/media/7c3e9a_4b8d2f1e6a9c4d7b8e2f5a1c3d6b9e0f~mv2.png/v1/fill/w_704,h_704/cropped.png"
 *       }
 *     }
 *   ]
 * }
 */

```

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

---