> 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

# GetOrCreateCampaignSuccessGuide

# Package: platform

# Namespace: SuggestionsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/ads/platform/suggestion-v1/get-or-create-campaign-success-guide.md

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

## Introduction

Retrieves a campaign success guide or creates one by analyzing the campaign's
landing page, campaign configuration, and relevant site connections.

The first call can take up to 120 seconds. Later calls return the saved guide
unless changes to the campaign require a new analysis.

---

## REST API

### Schema

```
 Method: getOrCreateCampaignSuccessGuide
 Description: Retrieves a campaign success guide or creates one by analyzing the campaign's landing page, campaign configuration, and relevant site connections.  The first call can take up to 120 seconds. Later calls return the saved guide unless changes to the campaign require a new analysis.
 URL: https://www.wixapis.com/pa-platform/suggestions/v1/campaign-success-guides/get-or-create
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId
 Method parameters: 
   param name: campaignId | type: campaignId | description: Campaign GUID. | required: true | validation: format GUID
   param name: platformType | type: PlatformType    
      - enum:
           UNKNOWN - 
           GOOGLE - 
           FACEBOOK - 
 Return type: GetOrCreateCampaignSuccessGuideResponse
  - name: campaignSuccessGuide | type: CampaignSuccessGuide | description: Generated or retrieved campaign success guide.  
     - name: id | type: string | description: Campaign success guide GUID. Same as the campaign GUID.  | read-only: true | validation: format GUID
     - name: url | type: string | description: Campaign landing page URL.  | read-only: true 
     - name: suggestions | type: array<CampaignSuccessGuideSuggestion> | description: Optimization suggestions in priority order. Includes only suggestions that need attention.  | read-only: true 
        - name: id | type: string | description: Suggestion GUID.  | read-only: true | validation: format GUID
        - name: type | type: CampaignSuccessGuideSuggestionType | description: Type of optimization suggestion.  | read-only: true 
             - enum:
             -     CLEAR_CTA_COPY: Recommendation to clarify the primary call-to-action button's conversion intent.
             -     ABOVE_THE_FOLD_CTA: Recommendation to place a call-to-action button where it's visible without scrolling.
             -     HEADER_MATCH: Recommendation to align the landing page heading with the campaign's ad headlines.
             -     CONVERSION_POINT: Recommendation to add a visible lead form or booking action to the landing page.
             -     GOOGLE_REVIEWS: Recommendation to display Google reviews or ratings on the landing page.
             -     TESTIMONIAL: Recommendation to display customer testimonials attributed to named individuals.
             -     CONTACT_AND_CREDIBILITY: Recommendation to display a phone number and email address on the landing page.
             -     FAQ_SECTION: Recommendation to add a visible FAQ section to the landing page.
             -     MINIMIZE_FORM_FIELDS: Recommendation to limit the landing page's lead form to 4 visible input fields.
             -     SOCIAL_CHANNELS: Recommendation to add a visible social media profile link to the landing page.
             -     GOOGLE_MERCHANT_CENTER_CONNECTION: Recommendation to connect a Google Merchant Center account to the Wix Stores site.
             -     GOOGLE_BUSINESS_PROFILE_CONNECTION: Recommendation to connect a Google Business Profile to the site.
             -     GOOGLE_ADS_SEARCH_THEMES: Recommendation to configure Google Ads search themes for the campaign.
             -     MOBILE_OPTIMIZATION: Mobile optimization improvements are recommended for the site.
             -     SITE_SPEED: Site speed improvements are recommended.
        - name: status | type: CampaignSuccessGuideSuggestionStatus | description: Current suggestion status. New suggestions have an `OPEN` status.  | read-only: true 
             - enum:
             -     OPEN: Suggestion is pending action by the user.
             -     COMPLETED: User has marked this suggestion as completed.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PLATFORM_NOT_SUPPORTED | Description: The specified platform type isn't supported. Set `platformType` to `GOOGLE`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CAMPAIGN_TYPE_NOT_SUPPORTED | Description: The specified campaign isn't a Google Ads Performance Max Leads campaign.


```

### Examples

### Get or Create Campaign Success Guide
Creates a success guide for a Google Ads Performance Max Leads campaign, or retrieves the saved guide.

```curl
curl -X POST \
'https://www.wixapis.com/pa-platform/suggestions/v1/campaign-success-guides/get-or-create' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "campaignId": "7d4a9c2e-86f1-4b37-a2d5-9e18c6f043ab",
  "platformType": "GOOGLE"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.paidAds.suggestions.getOrCreateCampaignSuccessGuide(campaignId, options)
 Description: Retrieves a campaign success guide or creates one by analyzing the campaign's landing page, campaign configuration, and relevant site connections.  The first call can take up to 120 seconds. Later calls return the saved guide unless changes to the campaign require a new analysis.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignId
 Method parameters: 
   param name: campaignId | type: string | description: Campaign GUID. | required: true | validation: format GUID
   param name: options | type: GetOrCreateCampaignSuccessGuideOptions  none  
        - name: platformType | type: PlatformType | description: Ad platform to generate suggestions for. Currently supports only `GOOGLE`.  
             - enum: UNKNOWN, GOOGLE, FACEBOOK
 Return type: PROMISE<GetOrCreateCampaignSuccessGuideResponse>
  - name: campaignSuccessGuide | type: CampaignSuccessGuide | description: Generated or retrieved campaign success guide.  
     - name: _id | type: string | description: Campaign success guide GUID. Same as the campaign GUID.  | read-only: true | validation: format GUID
     - name: url | type: string | description: Campaign landing page URL.  | read-only: true 
     - name: suggestions | type: array<CampaignSuccessGuideSuggestion> | description: Optimization suggestions in priority order. Includes only suggestions that need attention.  | read-only: true 
        - name: _id | type: string | description: Suggestion GUID.  | read-only: true | validation: format GUID
        - name: type | type: CampaignSuccessGuideSuggestionType | description: Type of optimization suggestion.  | read-only: true 
             - enum:
             -     CLEAR_CTA_COPY: Recommendation to clarify the primary call-to-action button's conversion intent.
             -     ABOVE_THE_FOLD_CTA: Recommendation to place a call-to-action button where it's visible without scrolling.
             -     HEADER_MATCH: Recommendation to align the landing page heading with the campaign's ad headlines.
             -     CONVERSION_POINT: Recommendation to add a visible lead form or booking action to the landing page.
             -     GOOGLE_REVIEWS: Recommendation to display Google reviews or ratings on the landing page.
             -     TESTIMONIAL: Recommendation to display customer testimonials attributed to named individuals.
             -     CONTACT_AND_CREDIBILITY: Recommendation to display a phone number and email address on the landing page.
             -     FAQ_SECTION: Recommendation to add a visible FAQ section to the landing page.
             -     MINIMIZE_FORM_FIELDS: Recommendation to limit the landing page's lead form to 4 visible input fields.
             -     SOCIAL_CHANNELS: Recommendation to add a visible social media profile link to the landing page.
             -     GOOGLE_MERCHANT_CENTER_CONNECTION: Recommendation to connect a Google Merchant Center account to the Wix Stores site.
             -     GOOGLE_BUSINESS_PROFILE_CONNECTION: Recommendation to connect a Google Business Profile to the site.
             -     GOOGLE_ADS_SEARCH_THEMES: Recommendation to configure Google Ads search themes for the campaign.
             -     MOBILE_OPTIMIZATION: Mobile optimization improvements are recommended for the site.
             -     SITE_SPEED: Site speed improvements are recommended.
        - name: status | type: CampaignSuccessGuideSuggestionStatus | description: Current suggestion status. New suggestions have an `OPEN` status.  | read-only: true 
             - enum:
             -     OPEN: Suggestion is pending action by the user.
             -     COMPLETED: User has marked this suggestion as completed.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PLATFORM_NOT_SUPPORTED | Description: The specified platform type isn't supported. Set `platformType` to `GOOGLE`.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CAMPAIGN_TYPE_NOT_SUPPORTED | Description: The specified campaign isn't a Google Ads Performance Max Leads campaign.


```

### Examples

### Get or Create Campaign Success Guide
Creates a success guide for a Google Ads Performance Max Leads campaign, or retrieves the saved guide.

```javascript
import { suggestions } from "@wix/paid-ads";

async function getOrCreateCampaignSuccessGuide() {
  const campaignSuccessGuideResponse =
    await suggestions.getOrCreateCampaignSuccessGuide(
      "7d4a9c2e-86f1-4b37-a2d5-9e18c6f043ab",
      { platformType: "GOOGLE" },
    );

  return campaignSuccessGuideResponse;
}

/* Promise resolves to:
 * {
 *   "campaignSuccessGuide": {
 *     "_id": "7d4a9c2e-86f1-4b37-a2d5-9e18c6f043ab",
 *     "url": "https://www.example.com/request-a-quote",
 *     "suggestions": [
 *       {
 *         "_id": "0a91f16e-6f71-4c73-a267-54f5f8ae6c32",
 *         "type": "GOOGLE_ADS_SEARCH_THEMES",
 *         "status": "OPEN"
 *       },
 *       {
 *         "_id": "131b82f1-44f5-4f32-8cf1-f783a5f35222",
 *         "type": "CLEAR_CTA_COPY",
 *         "status": "OPEN"
 *       }
 *     ]
 *   }
 * }
 */

```

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

---