> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/sample-flows.md

## Article Content:

# Google Ads APIs: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Install the app and create a Google Ads account

A site owner wants to set up Google Ads for their Wix site for the first time.

To install the app and create a Google Ads account:

1. Call [Install App](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-ads-app-installer-v1/install-google-ads-if-not-installed.md) to install the Wix Google Ads integration on the site. This is required before calling any other service.
1. Call [Create Account](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-account-v1/create-account.md) to create a new Google Ads account linked to the site. Pass the site owner's preferred currency in the `currency` field.

    If the call fails with `SITE_NOT_ELIGIBLE`, no account is created. The `failedCriteria` field lists what the site is missing: `SITE_PUBLISHED`, `HAS_PREMIUM`, or `DOMAIN_CONNECTED`. Ask the site owner to publish the site, upgrade to a Premium plan, or connect a domain, then call Create Account again.

## Create and launch a Performance Max campaign

A site owner wants to run a `PERFORMANCE_MAX_LEADS` campaign across all Google channels using their own creative assets.

To create and launch a `PERFORMANCE_MAX_LEADS` campaign:

1. Call [Get Text Asset Suggestions](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-suggestion-v1/get-text-asset-suggestions.md) with the site's landing page URL to get AI-generated headlines, descriptions, and other text assets.
1. Call [Get Image Asset Suggestions](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-suggestion-v1/get-image-asset-suggestions.md) to get AI-generated image assets. Images are automatically uploaded to the site's Wix Media Manager.
1. Call [Generate Budget Recommendation](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-suggestion-v1/generate-budget-recommendation.md) with `campaignType` set to `PERFORMANCE_MAX_LEADS` to get a budget recommendation from Google.
1. Call [Create Campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/campaign-v1/create-campaign.md) with `campaignType` set to `PERFORMANCE_MAX_LEADS`, `status` set to `DRAFT`, the site's landing page `url`, an asset group with the generated assets, and the recommended daily budget.
1. Call [Launch Campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/campaign-v1/launch-campaign.md) with the campaign's `id` to activate the draft.

## Pause and resume a campaign

A site owner wants to temporarily stop a running campaign and resume it later without losing its configuration.

To pause a campaign:

1. Call [Pause Campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/campaign-v1/pause-campaign.md) with the campaign's `id`. The campaign stops serving ads immediately, but all settings and data are preserved.

To resume the paused campaign:

1. Call [Resume Campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/campaign-v1/resume-campaign.md) with the campaign's `id` to reactivate it.

## Retrieve campaign performance analytics

A site owner wants to see how their running campaign is performing.

To retrieve campaign analytics:

1. Call [Query Performance Metrics](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/performance-metrics-v1/query-performance-metrics.md) with the campaign's `campaignResourceName` and a `dateRange` to retrieve impressions, clicks, CTR, and cost. Performance data is typically available within a few hours of campaign activity.
1. Optionally, call [Query Search Term Metrics V2](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/performance-metrics-v1/query-search-term-metrics-v-2.md) with the campaign's `id` as `campaignId` to see which search queries triggered the ads of a Smart or `PERFORMANCE_MAX_LEADS` campaign.
1. Optionally, call [Query Conversion Metrics](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/performance-metrics-v1/query-conversion-metrics.md) with the campaign's `id` to retrieve conversion and revenue data from Wix Analytics.

## Improve campaign performance

A site owner wants their campaign to generate more leads and conversions. The suggestions available for a campaign depend on its type and how long it has been running:

- **`PERFORMANCE_MAX_LEADS` campaigns that started running less than 14 days ago:** a campaign success guide. The guide is based on a scan of the campaign's configuration, its landing page, and site settings rather than on performance data, so it's available as soon as the campaign launches, before it receives any traffic.
- **`PERFORMANCE_MAX_LEADS` campaigns that have been running for 14 days or longer, and retail `PERFORMANCE_MAX` campaigns:** Google Ads recommendations. Google Ads generates recommendations from the account's settings and the campaign's recent performance.
- **Smart campaigns:** neither. Get Recommendations doesn't return recommendations for Smart campaigns, and campaign success guides are available only for `PERFORMANCE_MAX_LEADS` campaigns.

To check how long a campaign has been running, call [Get Campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/campaign-v1/get-campaign.md) with the campaign's `id`. For a running campaign, `actionDate` is when the campaign was last launched or resumed. If `actionDate` isn't set, the campaign started running when it was created, at `createdDate`.

To get a campaign success guide for a `PERFORMANCE_MAX_LEADS` campaign:

1. Call [Get or Create Campaign Success Guide](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/platform/suggestion-v1/get-or-create-campaign-success-guide.md) from the [Paid Ads Platform Suggestions API](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/platform/suggestion-v1/introduction.md), specifying the campaign's `id` as `campaignId` and setting `platformType` to `GOOGLE`. The response contains a prioritized list of suggestions for improving the campaign, its landing page, and the site. The first request can take up to 120 seconds while the guide is generated.
2. When the site owner completes a suggestion, call [Update Campaign Success Guide Suggestion Status](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/platform/suggestion-v1/update-campaign-success-guide-suggestion-status.md), specifying `campaignId`, the suggestion's `type`, and `COMPLETED` as its `status`.

To get Google Ads recommendations for a Performance Max campaign:

1. Call [Get Recommendations](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/google-suggestion-v1/get-recommendations.md), specifying the campaign's `id` as `campaignId`. The response contains the Google Ads recommendations for the campaign, such as raising its budget or adding assets. Each recommendation includes its `type` and, when Google Ads provides them, the estimated `impact` of applying it and type-specific `details`. Google Ads regenerates recommendations regularly, so results can change between calls.

To improve results for a site with a Smart campaign, create a `PERFORMANCE_MAX_LEADS` campaign. Creating new Smart campaigns is deprecated. For the flow, see [Create and launch a Performance Max campaign](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/sample-flows.md#create-and-launch-a-performance-max-campaign). To track an existing Smart campaign, see [Retrieve campaign performance analytics](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/sample-flows.md#retrieve-campaign-performance-analytics). A campaign that started running less than 14 days ago may not have enough performance data yet.

For more details, see [Paid Ads Platform Suggestions API: Sample Flows](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/platform/suggestion-v1/sample-flows.md).

## Retrieve payment details

A site owner wants to review their ad spend and upcoming charges for a Google Ads account.

To retrieve payment details:

1. Call [Get Payment Details](https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/payment-details-v1/get-payment-details.md) to get the current billing period breakdown, including ad spend, Wix service fee, total charge, and any coupon adjustments. A positive `creditBalance` means the account has credits available; a negative value indicates outstanding debt that hasn't yet been charged.