> 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

# QueryAssetPerformanceMetrics

# Package: googleAds

# Namespace: AnalyticsService

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

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

## Introduction

Retrieves a list of per-asset performance metrics for a Performance Max Leads campaign, given the provided filtering and sorting.
Returns performance data for individual creative assets such as headlines, descriptions, and images.
Not supported for other Performance Max campaign sub-types.

---

## REST API

### Schema

```
 Method: queryAssetPerformanceMetrics
 Description: Retrieves a list of per-asset performance metrics for a Performance Max Leads campaign, given the provided filtering and sorting. Returns performance data for individual creative assets such as headlines, descriptions, and images. Not supported for other Performance Max campaign sub-types.
 URL: https://www.wixapis.com/_serverless/pa-google/v1/asset-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 Performance Max Leads 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.  
    - 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 containing this asset was shown.
                 -     CLICKS: Number of clicks on the ad containing this asset.
                 -     CTR: Click-through rate for the ad containing this asset, expressed as a decimal.
                 -     COST: Total amount spent on ads containing this asset, in the account's currency.
                 -     ASSET_SOURCE: Whether the asset was created by the advertiser or automatically generated by Google Ads.
   param name: filter | type: AssetPerformanceMetricsFilter    
        - name: assetTypes | type: array<AssetFieldType> | description: Asset field types to include in results. When omitted or empty, all asset types are returned.  | validation: maxItems 50
             - enum:
             -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
             -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
             -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
             -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
             -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
             -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
             -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
             -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
             -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
             -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
             -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
             -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
   param name: sort | type: AssetPerformanceSorting    
        - name: field | type: AssetPerformanceQueryFields | description: Metric field to sort by.  
        - name: order | type: SortOrder | description: Sort direction.  
             - enum:
             -     ASC: Ascending order.
             -     DESC: Descending order.
 Return type: QueryAssetPerformanceMetricsResponse
  - name: results | type: array<AssetPerformanceMetrics> | description: Per-asset performance metric rows.  | validation: maxItems 1000
     - name: assetResourceName | type: string | description: Google Ads resource name of the asset group asset.  | validation: maxLength 1000
     - name: assetFieldType | type: AssetFieldType | description: Role the asset plays in the ad, for example HEADLINE, LONG_HEADLINE, DESCRIPTION, or MARKETING_IMAGE.  
         - enum:
         -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
         -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
         -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
         -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
         -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
         -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
         -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
         -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
     - name: assetContent | type: string | description: Content of the asset. For text assets this is the text itself. For image assets this is the image URL.  | validation: maxLength 1000
     - name: metrics | type: PerformanceMetrics | description: Aggregated performance metrics (clicks, impressions, CTR, cost) for this asset.  
        - name: impressions | type: integer | description: Number of times the ad was shown.  
        - name: clicks | type: integer | description: Number of clicks on the ad.  
        - name: ctr | type: number | description: Click-through rate expressed as a decimal, for example 0.05 for 5%.  
        - name: date | type: string | description: Date of this metric row, in YYYY-MM-DD format.  
        - name: campaignResourceName | type: string | description: Google Ads resource name of the campaign, in the format `customers/{customerId}/campaigns/{campaignId}`.  
        - name: phoneCalls | type: integer | description: Number of phone calls initiated through the ad.  
        - name: leads | type: integer | description: Number of leads generated by the campaign.  
        - name: cost | type: number | description: Total amount spent in the account's currency. Already converted from micros.  
        - name: clicksByAdNetworkType | type: AdNetworkTypeSegmentation | description: Click count broken down by the ad network that served the ad.  
           - name: search | type: integer | description: Count of the metric attributed to Google Search.  
           - name: other | type: integer | description: Count of the metric attributed to ad networks not individually listed here. For Smart campaigns this includes all non-search networks such as display, video, and partner networks. For Performance Max campaigns this captures any networks beyond the ones explicitly broken out below.  
           - name: gmail | type: integer | description: Count of the metric attributed to Gmail placements.  
           - name: youtube | type: integer | description: Count of the metric attributed to YouTube placements.  
           - name: discover | type: integer | description: Count of the metric attributed to Google Discover placements.  
           - name: display | type: integer | description: Count of the metric attributed to the Google Display Network.  
           - name: searchPartners | type: integer | description: Count of the metric attributed to Google Search partner sites.  
        - name: impressionsByAdNetworkType | type: AdNetworkTypeSegmentation | description: Impression count broken down by the ad network that served the ad.  
     - name: performanceLabel | type: AssetPerformanceLabel | description: Google Ads performance label assigned to this asset based on its status and relative CTR.  
         - enum:
         -     UNKNOWN: Unknown performance label.
         -     PENDING: Asset has been submitted but Google Ads has not yet assigned a performance label.
         -     DISAPPROVED: Asset was disapproved by Google Ads policy review.
         -     LEARNING: Asset is in the learning phase and does not yet have enough data for a label.
         -     LOW: Asset CTR is below the threshold for its asset type.
         -     GOOD: Asset CTR is between the low and excellent thresholds for its asset type.
         -     EXCELLENT: Asset CTR is at or above the excellent threshold for its asset type.
     - name: assetSource | type: AssetSource | description: Whether the asset was created by the advertiser or automatically generated by Google Ads.  
         - enum:
         -     UNKNOWN: Unknown asset source.
         -     ADVERTISER: Asset was created and uploaded by the advertiser.
         -     AUTOMATICALLY_CREATED: Asset was automatically generated by Google Ads.
  - name: summaryRow | type: PerformanceMetrics | description: Aggregated totals across all assets.  


```

### Examples

### Query asset performance metrics for a campaign
Retrieves performance metrics broken down by individual ad assets (headlines, descriptions, images) for a Performance Max Leads campaign.

```curl
curl -X POST \
'https://www.wixapis.com/google-ads/v1/asset-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", "ASSET_SOURCE"],
  "sort": {
    "field": "IMPRESSIONS",
    "order": "DESC"
  },
  "filter": {
    "assetTypes": ["HEADLINE", "DESCRIPTION", "MARKETING_IMAGE"]
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGoogleAds.performanceMetrics.queryAssetPerformanceMetrics(campaignId, options)
 Description: Retrieves a list of per-asset performance metrics for a Performance Max Leads campaign, given the provided filtering and sorting. Returns performance data for individual creative assets such as headlines, descriptions, and images. Not supported for other Performance Max campaign sub-types.
 # 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 Performance Max Leads campaign to query. | required: true | validation: format GUID
   param name: options | type: QueryAssetPerformanceMetricsOptions  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: AssetPerformanceSorting | description: Sorting to apply. Defaults to descending by impressions when omitted.  
           - name: field | type: AssetPerformanceQueryFields | description: Metric field to sort by.  
                 - enum:
                 -     UNSPECIFIED: Unknown field. Do not use.
                 -     IMPRESSIONS: Number of times the ad containing this asset was shown.
                 -     CLICKS: Number of clicks on the ad containing this asset.
                 -     CTR: Click-through rate for the ad containing this asset, expressed as a decimal.
                 -     COST: Total amount spent on ads containing this asset, in the account's currency.
                 -     ASSET_SOURCE: Whether the asset was created by the advertiser or automatically generated by Google Ads.
           - name: order | type: SortOrder | description: Sort direction.  
                 - enum:
                 -     ASC: Ascending order.
                 -     DESC: Descending order.
        - name: fields | type: array<AssetPerformanceQueryFields> | description: Metrics to include in each result row. When omitted, all available fields are returned.  | validation: maxItems 1000
        - name: filter | type: AssetPerformanceMetricsFilter | description: Filters to narrow results to specific asset types.  
           - name: assetTypes | type: array<AssetFieldType> | description: Asset field types to include in results. When omitted or empty, all asset types are returned.  | validation: maxItems 50
                 - enum:
                 -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
                 -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
                 -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
                 -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
                 -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
                 -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
                 -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
                 -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
                 -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
                 -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
                 -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
                 -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
 Return type: PROMISE<QueryAssetPerformanceMetricsResponse>
  - name: results | type: array<AssetPerformanceMetrics> | description: Per-asset performance metric rows.  | validation: maxItems 1000
     - name: assetResourceName | type: string | description: Google Ads resource name of the asset group asset.  | validation: maxLength 1000
     - name: assetFieldType | type: AssetFieldType | description: Role the asset plays in the ad, for example HEADLINE, LONG_HEADLINE, DESCRIPTION, or MARKETING_IMAGE.  
         - enum:
         -     HEADLINE: Short headline shown in ads. At least 3 required; up to 15 allowed. Maximum 30 characters.
         -     LONG_HEADLINE: Longer headline used in certain ad formats. Exactly 1 required. Maximum 90 characters.
         -     DESCRIPTION: Description shown below the headline. At least 2 required; up to 4 allowed. Maximum 90 characters.
         -     BUSINESS_NAME: Business name shown in the ad. Exactly 1 required. Maximum 25 characters.
         -     MARKETING_IMAGE: Landscape marketing image with a 1.91:1 aspect ratio (e.g. 1200x628). Multiple images allowed.
         -     SQUARE_MARKETING_IMAGE: Square marketing image with a 1:1 aspect ratio (e.g. 1200x1200). Multiple images allowed.
         -     LOGO: Square logo with a 1:1 aspect ratio (e.g. 1200x1200). A transparent background is recommended.
         -     PORTRAIT_MARKETING_IMAGE: Portrait marketing image with a 4:5 aspect ratio (e.g. 960x1200). Multiple images allowed.
         -     LANDSCAPE_LOGO: Landscape logo with a 4:1 aspect ratio (e.g. 1200x300).
         -     CALL_TO_ACTION_SELECTION: Call-to-action button label. Select a value from CallToActionType. Optional.
         -     YOUTUBE_VIDEO: YouTube video asset identified by an 11-character video ID. 1 to 5 videos recommended.
         -     MEDIA_BUNDLE: HTML5 media bundle (ZIP file). Mutate-only in Google Ads.
     - name: assetContent | type: string | description: Content of the asset. For text assets this is the text itself. For image assets this is the image URL.  | validation: maxLength 1000
     - name: metrics | type: PerformanceMetrics | description: Aggregated performance metrics (clicks, impressions, CTR, cost) for this asset.  
        - name: impressions | type: integer | description: Number of times the ad was shown.  
        - name: clicks | type: integer | description: Number of clicks on the ad.  
        - name: ctr | type: number | description: Click-through rate expressed as a decimal, for example 0.05 for 5%.  
        - name: date | type: string | description: Date of this metric row, in YYYY-MM-DD format.  
        - name: campaignResourceName | type: string | description: Google Ads resource name of the campaign, in the format `customers/{customerId}/campaigns/{campaignId}`.  
        - name: phoneCalls | type: integer | description: Number of phone calls initiated through the ad.  
        - name: leads | type: integer | description: Number of leads generated by the campaign.  
        - name: cost | type: number | description: Total amount spent in the account's currency. Already converted from micros.  
        - name: clicksByAdNetworkType | type: AdNetworkTypeSegmentation | description: Click count broken down by the ad network that served the ad.  
           - name: search | type: integer | description: Count of the metric attributed to Google Search.  
           - name: other | type: integer | description: Count of the metric attributed to ad networks not individually listed here. For Smart campaigns this includes all non-search networks such as display, video, and partner networks. For Performance Max campaigns this captures any networks beyond the ones explicitly broken out below.  
           - name: gmail | type: integer | description: Count of the metric attributed to Gmail placements.  
           - name: youtube | type: integer | description: Count of the metric attributed to YouTube placements.  
           - name: discover | type: integer | description: Count of the metric attributed to Google Discover placements.  
           - name: display | type: integer | description: Count of the metric attributed to the Google Display Network.  
           - name: searchPartners | type: integer | description: Count of the metric attributed to Google Search partner sites.  
        - name: impressionsByAdNetworkType | type: AdNetworkTypeSegmentation | description: Impression count broken down by the ad network that served the ad.  
     - name: performanceLabel | type: AssetPerformanceLabel | description: Google Ads performance label assigned to this asset based on its status and relative CTR.  
         - enum:
         -     UNKNOWN: Unknown performance label.
         -     PENDING: Asset has been submitted but Google Ads has not yet assigned a performance label.
         -     DISAPPROVED: Asset was disapproved by Google Ads policy review.
         -     LEARNING: Asset is in the learning phase and does not yet have enough data for a label.
         -     LOW: Asset CTR is below the threshold for its asset type.
         -     GOOD: Asset CTR is between the low and excellent thresholds for its asset type.
         -     EXCELLENT: Asset CTR is at or above the excellent threshold for its asset type.
     - name: assetSource | type: AssetSource | description: Whether the asset was created by the advertiser or automatically generated by Google Ads.  
         - enum:
         -     UNKNOWN: Unknown asset source.
         -     ADVERTISER: Asset was created and uploaded by the advertiser.
         -     AUTOMATICALLY_CREATED: Asset was automatically generated by Google Ads.
  - name: summaryRow | type: PerformanceMetrics | description: Aggregated totals across all assets.  


```

### Examples

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

async function queryAssetPerformanceMetrics() {
  const response = await performanceMetrics.queryAssetPerformanceMetrics(
    'b3f8e241-7c4a-4d19-a562-9f1e30d87c05',
    {
      dateRange: {
        custom: {
          from: '2026-03-01',
          to: '2026-03-31',
        },
      },
      fields: ['IMPRESSIONS', 'CLICKS', 'CTR', 'COST', 'ASSET_SOURCE'],
      sort: {
        field: 'IMPRESSIONS',
        order: 'DESC',
      },
      filter: {
        assetTypes: ['HEADLINE', 'DESCRIPTION', 'MARKETING_IMAGE'],
      },
    },
  );
}

/* Promise resolves to:
 * {
 *   "results": [
 *     {
 *       "assetResourceName": "customers/3827461950/assets/1234567890",
 *       "assetFieldType": "HEADLINE",
 *       "assetContent": "Shop the Latest Summer Collection",
 *       "assetSource": "ADVERTISER",
 *       "performanceLabel": "EXCELLENT",
 *       "metrics": {
 *         "impressions": 22410,
 *         "clicks": 1571,
 *         "ctr": 0.0701,
 *         "cost": 660.42,
 *         "leads": 41
 *       }
 *     },
 *     {
 *       "assetResourceName": "customers/3827461950/assets/9876543210",
 *       "assetFieldType": "DESCRIPTION",
 *       "assetContent": "Free shipping on orders over $50. Shop now.",
 *       "assetSource": "ADVERTISER",
 *       "performanceLabel": "GOOD",
 *       "metrics": {
 *         "impressions": 18334,
 *         "clicks": 1283,
 *         "ctr": 0.0700,
 *         "cost": 539.46,
 *         "leads": 33
 *       }
 *     }
 *   ],
 *   "summaryRow": {
 *     "impressions": 47381,
 *     "clicks": 3316,
 *     "ctr": 0.0699,
 *     "cost": 1408.65,
 *     "leads": 87
 *   }
 * }
 */

```

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

---