> 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

# QueryShoppingPerformanceMetrics

# Package: googleAds

# Namespace: AnalyticsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/ads/google-ads/performance-metrics-v1/query-shopping-performance-metrics.md

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

## Introduction

Retrieves a list of per-product performance metrics for a shopping or retail Performance Max campaign, given the provided filtering and sorting.
The conversions and conversionRate fields always return 0 and are not queried from Google Ads.
Due to product lookup complexity, this method has a 120-second SLA.

---

## REST API

### Schema

```
 Method: queryShoppingPerformanceMetrics
 Description: Retrieves a list of per-product performance metrics for a shopping or retail Performance Max campaign, given the provided filtering and sorting. The conversions and conversionRate fields always return 0 and are not queried from Google Ads. Due to product lookup complexity, this method has a 120-second SLA.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/shopping-performance-metrics
 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: Wix internal campaign GUID (GUID) of the shopping or retail Performance Max campaign to query. | required: true 
   param name: dateRange | type: DateRange | description: A date range used to filter analytics queries, either predefined or custom.  
    - ONE-OF: 
     - name: custom | type: CustomDateRange | description: Custom date range.  
        - name: from | type: string | description: Start date, in `YYYY-MM-DD` format.  | validation: maxLength 20
        - name: to | type: string | description: End date, in `YYYY-MM-DD` format.  | validation: maxLength 20
     - name: predefined | type: PredefinedDateRange | description: Predefined date range.  
         - enum:
         -     UNSPECIFIED: Not specified.
         -     TODAY: Today only.
         -     YESTERDAY: Yesterday only.
         -     LAST_7_DAYS: The last 7 days not including today.
         -     LAST_BUSINESS_WEEK: The 5 day business week, Monday through Friday, of the previous business week.
         -     THIS_MONTH: All days in the current month.
         -     LAST_MONTH: All days in the previous month.
         -     LAST_14_DAYS: The last 14 days not including today.
         -     LAST_30_DAYS: The last 30 days not including today.
         -     THIS_WEEK_SUN_TODAY: The period between the previous Sunday and the current day.
         -     THIS_WEEK_MON_TODAY: The period between the previous Monday and the current day.
         -     LAST_WEEK_SUN_SAT: The 7-day period starting with the previous Sunday.
         -     LAST_WEEK_MON_SUN: The 7-day period starting with the previous Monday.
         -     LIFETIME: Since the beginning of the campaign.
   param name: fields | type: array<fields> | description: Metrics to include in each result row. When omitted, all available fields are returned.  | validation: maxItems 1000
                 - enum:
                 -     UNSPECIFIED: Unknown field. Do not use.
                 -     IMPRESSIONS: Number of times the ad was shown.
                 -     CLICKS: Number of clicks on the ad.
                 -     CTR: Click-through rate expressed as a decimal, for example 0.05 for 5%.
                 -     DATE: The date of the metric row, in YYYY-MM-DD format.
                 -     PHONE_CALLS: Number of phone calls initiated through the ad.
                 -     LEADS: Number of leads generated by the campaign.
                 -     COST: Total amount spent on the campaign in the account's currency.
                 -     COST_PER_CLICK: Average cost per click in the account's currency.
                 -     CLICKS_BY_AD_NETWORK_TYPE: Click count broken down by ad network type.
                 -     IMPRESSIONS_BY_AD_NETWORK_TYPE: Impression count broken down by ad network type.
                 -     PHONE_CALL_LEADS: Number of calls from the ad that Google Ads counted as leads.
   param name: paging | type: Paging | description: Paging information for an analytics query.  
        - name: nextPageToken | type: string | description: Token for retrieving the next page of results.  | validation: maxLength 100
        - name: pageSize | type: integer | description: Number of results to return.  
   param name: resultSetting | type: ShoppingPerformanceResultSetting    
      - enum:
           UNSPECIFIED - Unknown result setting. Do not use.
           SUMMARY_ONLY - Return only the summaryRow. Per-product results are omitted.
           RESULTS_ONLY - Return only the per-product result rows. The summaryRow is omitted.
           SUMMARY_AND_RESULTS - Return both per-product result rows and the summaryRow.
   param name: sort | type: PerformanceSorting    
        - name: field | type: PerformanceQueryFields | description: Metric field to sort by.  
        - name: order | type: SortOrder | description: Sort direction.  
             - enum:
             -     ASC: Ascending order.
             -     DESC: Descending order.
 Return type: QueryShoppingPerformanceMetricsResponse
  - name: results | type: array<ShoppingPerformanceMetrics> | description: Per-product performance metric rows for the requested page.  | validation: maxItems 10000
     - name: impressions | type: integer | description: Number of times the product ad was shown.  | read-only: true 
     - name: clicks | type: integer | description: Number of clicks on the product ad.  | read-only: true 
     - name: ctr | type: number | description: Click-through rate expressed as a decimal, for example 0.05 for 5%.  | read-only: true 
     - name: date | type: string | description: Date of this metric row, in YYYY-MM-DD format.  | read-only: true 
     - name: campaignResourceName | type: string | description: Google Ads resource name of the campaign, in the format `customers/{customerId}/campaigns/{campaignId}`.  | read-only: true 
     - name: cost | type: number | description: Total amount spent on this product in the account's currency.  | read-only: true 
     - name: productTitle | type: string | description: Display title of the product.  | read-only: true 
     - name: productImageUrl | type: string | description: URL of the product's image.  | read-only: true 
     - name: conversionRate | type: number | description: Conversion rate for this product. Always returns 0 because conversions are not queried from Google Ads for shopping campaigns.  | read-only: true 
     - name: conversions | type: number | description: Number of conversions attributed to this product. Always returns 0 because conversions are not queried from Google Ads for shopping campaigns.  | read-only: true 
     - name: costPerClick | type: number | description: Average cost per click in the account's currency.  | read-only: true 
     - name: productId | type: string | description: Wix product GUID resolved from the Google Ads product item GUID.  | read-only: true 
  - name: summaryRow | type: ShoppingPerformanceMetricsSummary | description: Aggregated totals across all products.  
     - name: totalConversions | type: integer | description: Total number of conversions or purchases across all products.  | read-only: true 
     - name: totalRevenue | type: number | description: Total revenue across all products in the account's currency.  | read-only: true 
     - name: roas | type: number | description: Return on ad spend (revenue divided by cost).  | read-only: true 
     - name: moreResultsAvailable | type: boolean | description: Whether additional results exist for the campaign regardless of the current date filters.  | read-only: true 
  - name: nextPageToken | type: string | description: Token to pass in the next request to retrieve the following page of results.  


```

### Examples

### Query shopping performance metrics for a campaign
Retrieves per-product shopping performance metrics for a Google Ads Shopping campaign, including conversions and ROAS.

```curl
curl -X POST \
'https://www.wixapis.com/_serverless/pa-google/v1/shopping-performance-metrics' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "campaignId": "b3f8e241-7c4a-4d19-a562-9f1e30d87c05",
  "dateRange": {
    "custom": {
      "from": "2026-03-01",
      "to": "2026-03-31"
    }
  },
  "fields": ["IMPRESSIONS", "CLICKS", "CTR", "COST", "COST_PER_CLICK"],
  "sort": {
    "field": "COST",
    "order": "DESC"
  },
  "paging": {
    "pageSize": 10
  },
  "resultSetting": "SUMMARY_AND_RESULTS"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.performanceMetrics.queryShoppingPerformanceMetrics(campaignId, options)
 Description: Retrieves a list of per-product performance metrics for a shopping or retail Performance Max campaign, given the provided filtering and sorting. The conversions and conversionRate fields always return 0 and are not queried from Google Ads. Due to product lookup complexity, this method has a 120-second SLA.
 # 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: Wix internal campaign GUID (GUID) of the shopping or retail Performance Max campaign to query. | required: true 
   param name: options | type: QueryShoppingPerformanceMetricsOptions  none  
        - name: dateRange | type: DateRange | description: Date range to query. When omitted, defaults to the campaign lifetime.  
           - ONE-OF: 
              - name: custom | type: CustomDateRange | description: Custom date range.  
                 - name: from | type: string | description: Start date, in `YYYY-MM-DD` format.  | validation: maxLength 20
                 - name: to | type: string | description: End date, in `YYYY-MM-DD` format.  | validation: maxLength 20
              - name: predefined | type: PredefinedDateRange | description: Predefined date range.  
                     - enum:
                     -     UNSPECIFIED: Not specified.
                     -     TODAY: Today only.
                     -     YESTERDAY: Yesterday only.
                     -     LAST_7_DAYS: The last 7 days not including today.
                     -     LAST_BUSINESS_WEEK: The 5 day business week, Monday through Friday, of the previous business week.
                     -     THIS_MONTH: All days in the current month.
                     -     LAST_MONTH: All days in the previous month.
                     -     LAST_14_DAYS: The last 14 days not including today.
                     -     LAST_30_DAYS: The last 30 days not including today.
                     -     THIS_WEEK_SUN_TODAY: The period between the previous Sunday and the current day.
                     -     THIS_WEEK_MON_TODAY: The period between the previous Monday and the current day.
                     -     LAST_WEEK_SUN_SAT: The 7-day period starting with the previous Sunday.
                     -     LAST_WEEK_MON_SUN: The 7-day period starting with the previous Monday.
                     -     LIFETIME: Since the beginning of the campaign.
        - name: sort | type: PerformanceSorting | description: Sorting to apply. Defaults to descending by date when omitted.  
           - name: field | type: PerformanceQueryFields | description: Metric field to sort by.  
                 - enum:
                 -     UNSPECIFIED: Unknown field. Do not use.
                 -     IMPRESSIONS: Number of times the ad was shown.
                 -     CLICKS: Number of clicks on the ad.
                 -     CTR: Click-through rate expressed as a decimal, for example 0.05 for 5%.
                 -     DATE: The date of the metric row, in YYYY-MM-DD format.
                 -     PHONE_CALLS: Number of phone calls initiated through the ad.
                 -     LEADS: Number of leads generated by the campaign.
                 -     COST: Total amount spent on the campaign in the account's currency.
                 -     COST_PER_CLICK: Average cost per click in the account's currency.
                 -     CLICKS_BY_AD_NETWORK_TYPE: Click count broken down by ad network type.
                 -     IMPRESSIONS_BY_AD_NETWORK_TYPE: Impression count broken down by ad network type.
                 -     PHONE_CALL_LEADS: Number of calls from the ad that Google Ads counted as leads.
           - name: order | type: SortOrder | description: Sort direction.  
                 - enum:
                 -     ASC: Ascending order.
                 -     DESC: Descending order.
        - name: fields | type: array<PerformanceQueryFields> | description: Metrics to include in each result row. When omitted, all available fields are returned.  | validation: maxItems 1000
        - name: paging | type: Paging | description: Paging to apply.  
           - name: nextPageToken | type: string | description: Token for retrieving the next page of results.  | validation: maxLength 100
           - name: pageSize | type: integer | description: Number of results to return.  
        - name: resultSetting | type: ShoppingPerformanceResultSetting | description: Controls whether the response contains per-product results, a summary row, or both.  
             - enum:
             -     UNSPECIFIED: Unknown result setting. Do not use.
             -     SUMMARY_ONLY: Return only the summaryRow. Per-product results are omitted.
             -     RESULTS_ONLY: Return only the per-product result rows. The summaryRow is omitted.
             -     SUMMARY_AND_RESULTS: Return both per-product result rows and the summaryRow.
 Return type: PROMISE<QueryShoppingPerformanceMetricsResponse>
  - name: results | type: array<ShoppingPerformanceMetrics> | description: Per-product performance metric rows for the requested page.  | validation: maxItems 10000
     - name: impressions | type: integer | description: Number of times the product ad was shown.  | read-only: true 
     - name: clicks | type: integer | description: Number of clicks on the product ad.  | read-only: true 
     - name: ctr | type: number | description: Click-through rate expressed as a decimal, for example 0.05 for 5%.  | read-only: true 
     - name: date | type: string | description: Date of this metric row, in YYYY-MM-DD format.  | read-only: true 
     - name: campaignResourceName | type: string | description: Google Ads resource name of the campaign, in the format `customers/{customerId}/campaigns/{campaignId}`.  | read-only: true 
     - name: cost | type: number | description: Total amount spent on this product in the account's currency.  | read-only: true 
     - name: productTitle | type: string | description: Display title of the product.  | read-only: true 
     - name: productImageUrl | type: string | description: URL of the product's image.  | read-only: true 
     - name: conversionRate | type: number | description: Conversion rate for this product. Always returns 0 because conversions are not queried from Google Ads for shopping campaigns.  | read-only: true 
     - name: conversions | type: number | description: Number of conversions attributed to this product. Always returns 0 because conversions are not queried from Google Ads for shopping campaigns.  | read-only: true 
     - name: costPerClick | type: number | description: Average cost per click in the account's currency.  | read-only: true 
     - name: productId | type: string | description: Wix product GUID resolved from the Google Ads product item GUID.  | read-only: true 
  - name: summaryRow | type: ShoppingPerformanceMetricsSummary | description: Aggregated totals across all products.  
     - name: totalConversions | type: integer | description: Total number of conversions or purchases across all products.  | read-only: true 
     - name: totalRevenue | type: number | description: Total revenue across all products in the account's currency.  | read-only: true 
     - name: roas | type: number | description: Return on ad spend (revenue divided by cost).  | read-only: true 
     - name: moreResultsAvailable | type: boolean | description: Whether additional results exist for the campaign regardless of the current date filters.  | read-only: true 
  - name: nextPageToken | type: string | description: Token to pass in the next request to retrieve the following page of results.  


```

### Examples

### Query shopping performance metrics for a campaign
```javascript
import { performanceMetrics } from '@wix/promote-google-ads';

async function queryShoppingPerformanceMetrics() {
  const response = await performanceMetrics.queryShoppingPerformanceMetrics(
    'b3f8e241-7c4a-4d19-a562-9f1e30d87c05',
    {
      dateRange: {
        custom: {
          from: '2026-03-01',
          to: '2026-03-31',
        },
      },
      fields: ['IMPRESSIONS', 'CLICKS', 'CTR', 'COST', 'COST_PER_CLICK'],
      sort: {
        field: 'COST',
        order: 'DESC',
      },
      paging: {
        pageSize: 10,
      },
      resultSetting: 'SUMMARY_AND_RESULTS',
    },
  );
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "campaignResourceName": "customers/3827461950/campaigns/7412836509",
 *       "productId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
 *       "productTitle": "Classic Canvas Tote Bag",
 *       "productImageUrl": "https://static.wixstatic.com/media/canvas-tote.jpg",
 *       "date": "2026-03-31",
 *       "impressions": 3240,
 *       "clicks": 198,
 *       "ctr": 0.0611,
 *       "cost": 83.16,
 *       "costPerClick": 0.42,
 *       "conversions": 24,
 *       "conversionRate": 0.1212
 *     },
 *     {
 *       "campaignResourceName": "customers/3827461950/campaigns/7412836509",
 *       "productId": "f7e8d9c0-b1a2-3456-cdef-789012345678",
 *       "productTitle": "Leather Crossbody Bag",
 *       "productImageUrl": "https://static.wixstatic.com/media/leather-crossbody.jpg",
 *       "date": "2026-03-31",
 *       "impressions": 2510,
 *       "clicks": 152,
 *       "ctr": 0.0606,
 *       "cost": 64.84,
 *       "costPerClick": 0.43,
 *       "conversions": 18,
 *       "conversionRate": 0.1184
 *     }
 *   ],
 *   "summaryRow": {
 *     "totalConversions": 214,
 *     "totalRevenue": 18750.40,
 *     "roas": 13.31,
 *     "moreResultsAvailable": true
 *   },
 *   "nextPageToken": "CAoQAA"
 * }
 */

```

### queryShoppingPerformanceMetrics (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 { performanceMetrics } 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: { performanceMetrics },
  // Include the auth strategy and host as relevant
});


async function queryShoppingPerformanceMetrics(campaignId,options) {
  const response = await myWixClient.performanceMetrics.queryShoppingPerformanceMetrics(campaignId,options);
};
```

---