> 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

# GetSearchThemeSuggestions

# Package: googleAds

# Namespace: SuggestionsService

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

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

## Introduction

Retrieves AI-generated search theme suggestions for a Performance Max campaign.
Responses may take up to 60 seconds. `textSuggestionInfo.languageCode` is required.

---

## REST API

### Schema

```
 Method: getSearchThemeSuggestions
 Description: Retrieves AI-generated search theme suggestions for a Performance Max campaign. Responses may take up to 60 seconds. `textSuggestionInfo.languageCode` is required.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/search-theme-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:  textSuggestionInfo, textSuggestionInfo.languageCode
 Method parameters: 
   param name: landingPageUrl | type: landingPageUrl | description: Public URL of the campaign landing page, used to analyze content and suggest relevant themes.  | validation: format WEB_URL
   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: GetSearchThemeSuggestionsResponse
  - name: searchThemes | type: array<string> | description: AI-generated search theme strings for use in a Performance Max campaign.  | validation: maxItems 25, maxLength 1000


```

### Examples

### Get Search Theme Suggestions
```curl
curl -X POST \
  'https://www.wixapis.com/google-ads/v1/search-theme-suggestions' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{
    "landingPageUrl": "https://www.example.com",
    "textSuggestionInfo": {
      "languageCode": "en"
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.suggestions.getSearchThemeSuggestions(options)
 Description: Retrieves AI-generated search theme suggestions for a Performance Max campaign. Responses may take up to 60 seconds. `textSuggestionInfo.languageCode` is required.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  options.textSuggestionInfo, options.textSuggestionInfo.languageCode, options
 Method parameters: 
   param name: options | type: GetSearchThemeSuggestionsOptions  none | required: true 
        - name: landingPageUrl | type: string | description: Public URL of the campaign landing page, used to analyze content and suggest relevant themes.  | validation: format WEB_URL
        - name: textSuggestionInfo | type: TextSuggestionInfo | description: Language and exclusion settings for search theme 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
 Return type: PROMISE<GetSearchThemeSuggestionsResponse>
  - name: searchThemes | type: array<string> | description: AI-generated search theme strings for use in a Performance Max campaign.  | validation: maxItems 25, maxLength 1000


```

### Examples

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

const response = await suggestions.getSearchThemeSuggestions({
  landingPageUrl: 'https://www.example.com',
  textSuggestionInfo: {
    languageCode: 'en',
  },
});

/* Promise resolves to:
 * {
 *   "searchThemes": [
 *     "artisan bakery",
 *     "custom birthday cakes",
 *     "fresh bread delivery",
 *     "gluten free pastries",
 *     "wedding cake shop"
 *   ]
 * }
 */

```

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

---