> 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

# QueryConversionMetrics

# Package: googleAds

# Namespace: AnalyticsService

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

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

## Introduction

Retrieves aggregated conversion metrics for a campaign from Wix Analytics.
Both campaignId and dateRange are required. Due to analytics query complexity, this method has a 120-second SLA.

---

## REST API

### Schema

```
 Method: queryConversionMetrics
 Description: Retrieves aggregated conversion metrics for a campaign from Wix Analytics. Both campaignId and dateRange are required. Due to analytics query complexity, this method has a 120-second SLA.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/conversion-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 campaign to query. | required: true | validation: format GUID
   param name: dateRange | type: DateRange | description: A date range used to filter analytics queries, either predefined or custom. | required: true 
    - ONE-OF: - required: true
     - 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.
 Return type: QueryConversionMetricsResponse
  - name: summaryRow | type: ConversionMetrics | description: Aggregated conversion totals for the campaign over the requested date range.  
     - name: orders | type: integer | description: Number of orders.  
     - name: revenue | type: number | description: Revenue generated.  | validation: format double
     - name: date | type: string | description: Date the metrics apply to.  
     - name: leads | type: integer | description: Number of leads.  
     - name: cpl | type: number | description: Cost per lead, calculated as total campaign spend for the period divided by `leads`.  Not returned when `leads` or spend is `0`.  | validation: format double
     - name: leadsConversionRate | type: number | description: Conversion rate, calculated as `leads` divided by clicks.  Not returned when `leads` or clicks is `0`.  | validation: format double
     - name: cpp | type: number | description: Cost per purchase, calculated as total campaign spend for the period divided by `orders`.  Not returned when `orders` or spend is `0`.  | validation: format double
     - name: roas | type: number | description: Return on ad spend, calculated as `revenue` divided by total campaign spend for the period.  Not returned when `revenue` or spend is `0`.  | validation: format double


```

### Examples

### Query conversion metrics for a campaign
Retrieves conversion metrics (orders, revenue, leads, ROAS) for a Google Ads campaign over a custom date range.

```curl
curl -X POST \
'https://www.wixapis.com/google-ads/v1/conversion-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"
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.performanceMetrics.queryConversionMetrics(campaignId, options)
 Description: Retrieves aggregated conversion metrics for a campaign from Wix Analytics. Both campaignId and dateRange are required. Due to analytics query 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, options.dateRange, options
 Method parameters: 
   param name: campaignId | type: string | description: Wix internal campaign GUID (GUID) of the campaign to query. | required: true | validation: format GUID
   param name: options | type: QueryConversionMetricsOptions  none | required: true 
        - name: dateRange | type: DateRange | description: Date range to query. Required. | required: true 
           - 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.
 Return type: PROMISE<QueryConversionMetricsResponse>
  - name: summaryRow | type: ConversionMetrics | description: Aggregated conversion totals for the campaign over the requested date range.  
     - name: orders | type: integer | description: Number of orders.  
     - name: revenue | type: number | description: Revenue generated.  
     - name: date | type: string | description: Date the metrics apply to.  
     - name: leads | type: integer | description: Number of leads.  
     - name: cpl | type: number | description: Cost per lead, calculated as total campaign spend for the period divided by `leads`.  Not returned when `leads` or spend is `0`.  
     - name: leadsConversionRate | type: number | description: Conversion rate, calculated as `leads` divided by clicks.  Not returned when `leads` or clicks is `0`.  
     - name: cpp | type: number | description: Cost per purchase, calculated as total campaign spend for the period divided by `orders`.  Not returned when `orders` or spend is `0`.  
     - name: roas | type: number | description: Return on ad spend, calculated as `revenue` divided by total campaign spend for the period.  Not returned when `revenue` or spend is `0`.  


```

### Examples

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

async function queryConversionMetrics() {
  const response = await performanceMetrics.queryConversionMetrics(
    'b3f8e241-7c4a-4d19-a562-9f1e30d87c05',
    {
      dateRange: {
        custom: {
          from: '2026-03-01',
          to: '2026-03-31',
        },
      },
    },
  );
}

/* Promise resolves to:
 * {
 *   "summaryRow": {
 *     "date": "",
 *     "orders": 214,
 *     "revenue": 18750.40,
 *     "leads": 87,
 *     "cpl": 16.19,
 *     "leadsConversionRate": 0.0262,
 *     "cpp": 6.58,
 *     "roas": 13.31
 *   }
 * }
 */

```

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

---