> 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

# ListStatistics

# Package: emailMarketing

# Namespace: CampaignStatisticsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-statistics.md

## Permission Scopes:
Read Email Marketing: SCOPE.DC-PROMOTE.READ-EMAIL-MARKETING

## Introduction

Retrieves a list of statistics for up to 100 selected campaigns.

For each campaign, returns the total activity count for the campaign's landing page and email. For example, the total
number of times the landing page was opened, or the total number of email recipients that clicked a link in an email.

Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information for a site's campaigns.
Call [List Recipients](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-recipients.md) to retrieve a list of recipients and their activities for a specific campaign.

---

## REST API

### Schema

```
 Method: listStatistics
 Description: Retrieves a list of statistics for up to 100 selected campaigns.  For each campaign, returns the total activity count for the campaign's landing page and email. For example, the total number of times the landing page was opened, or the total number of email recipients that clicked a link in an email.  Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information for a site's campaigns. Call [List Recipients](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-recipients.md) to retrieve a list of recipients and their activities for a specific campaign.
 URL: https://www.wixapis.com/email-marketing/v1/campaigns/statistics
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignIds
 Method parameters: 
   query param name: campaignIds | type: array<campaignIds> | description: IDs of the campaigns to retrieve (max 100 campaigns). | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: ListStatisticsResponse
  - name: statistics | type: array<CampaignStatisticsContainer> | description: List of statistics.  
     - name: campaignId | type: string | description: Campaign GUID.  | validation: format GUID
     - name: landingPage | type: LandingPageStatistics | description: Landing page statistics. Returned only for published campaigns.  
        - name: opened | type: integer | description: Number of times the landing page was loaded or viewed.  
        - name: clicked | type: integer | description: Number of times a link was clicked in a landing page.  
     - name: email | type: DistributionStatistics | description: Email campaign statistics. Returned only for published campaigns.  
        - name: delivered | type: integer | description: Number of delivered emails.  
        - name: opened | type: integer | description: Number of recipients who opened an email.  If the same recipient opened the same email twice, it is counted as a one unique open.  
        - name: clicked | type: integer | description: Number of recipients who clicked a link in the email.  If the same recipient clicked the same link twice, it is counted as a one unique click.  If the same recipient clicked different links, it is counted as a one unique click.  
        - name: bounced | type: integer | description: Number of emails that didn't reach the recipient.  
        - name: complained | type: integer | description: Number of recipients who reported the email as spam.  
        - name: notSent | type: integer | description: Number of audience members who didn't receive the email because the campaign was terminated during sampling before reaching the full audience.  


```

### Examples

### List Statistics for more than 1 campaign
```curl
curl -X GET 'https://www.wixapis.com/email-marketing/v1/campaigns/statistics?campaignIds=5274f9f6-7031-40d6-972a-b3212ed53f58&campaignIds=8a7f8211-99e4-4116-9d41-da2d11c1e161' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.emailMarketing.campaigns.listStatistics(campaignIds)
 Description: Retrieves a list of statistics for up to 100 selected campaigns.  For each campaign, returns the total activity count for the campaign's landing page and email. For example, the total number of times the landing page was opened, or the total number of email recipients that clicked a link in an email.  Call [List Campaigns](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-campaigns.md) to retrieve additional information for a site's campaigns. Call [List Recipients](https://dev.wix.com/docs/api-reference/business-management/marketing/emails/email-marketing/campaign/list-recipients.md) to retrieve a list of recipients and their activities for a specific campaign.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  campaignIds
 Method parameters: 
   param name: campaignIds | type: array<string> | description: IDs of the campaigns to retrieve (max 100 campaigns). | required: true | validation: minItems 1, maxItems 100, format GUID
 Return type: PROMISE<ListStatisticsResponse>
  - name: statistics | type: array<CampaignStatisticsContainer> | description: List of statistics.  
     - name: campaignId | type: string | description: Campaign GUID.  | validation: format GUID
     - name: landingPage | type: LandingPageStatistics | description: Landing page statistics. Returned only for published campaigns.  
        - name: opened | type: integer | description: Number of times the landing page was loaded or viewed.  
        - name: clicked | type: integer | description: Number of times a link was clicked in a landing page.  
     - name: email | type: DistributionStatistics | description: Email campaign statistics. Returned only for published campaigns.  
        - name: delivered | type: integer | description: Number of delivered emails.  
        - name: opened | type: integer | description: Number of recipients who opened an email.  If the same recipient opened the same email twice, it is counted as a one unique open.  
        - name: clicked | type: integer | description: Number of recipients who clicked a link in the email.  If the same recipient clicked the same link twice, it is counted as a one unique click.  If the same recipient clicked different links, it is counted as a one unique click.  
        - name: bounced | type: integer | description: Number of emails that didn't reach the recipient.  
        - name: complained | type: integer | description: Number of recipients who reported the email as spam.  
        - name: notSent | type: integer | description: Number of audience members who didn't receive the email because the campaign was terminated during sampling before reaching the full audience.  


```

### Examples

### Retrieves a list of statistics for up to 100 selected campaigns
```javascript
import { campaigns } from '@wix/email-marketing';

// Sample campaignIds = ['ea46013c-bbbf-4617-ad5d-9247bc4c0970', 'ea46013c-bb6f-4617-ad5d-9247bc4g5478', 'ea46013c-bf9f-4617-ad5d-9247bcg0837'];

export async function listStatistics(campaignIds) {
  try {
    const results = await campaigns.listStatistics(campaignIds);

    console.log("Success! Your statistics are listed.")
    return results;
  } catch (error) {
    console.error(error);
  }
}

/* Promise resolves to:
 * {
 *   "statistics": [
 *     {
 *       "campaignId": "ea46013c-bbbf-4617-ad5d-9247bc4c0970",
 *       "landingPage": {
 *         "opened": 0,
 *         "clicked": 0
 *     },
 *       "email": {
 *         "delivered": 1,
 *         "opened": 1,
 *         "clicked": 0,
 *         "bounced": 0,
 *         "complained": 0,
 *         "notSent": 0
 *     },
 *     {
 *       "campaignId": "ea46013c-bb6f-4617-ad5d-9247bc4g5478",
 *       "landingPage": {
 *         "opened": 8,
 *         "clicked": 12
 *       },
 *       "email": {
 *         "delivered": 35,
 *         "opened": 22,
 *         "clicked": 15,
 *         "bounced": 0,
 *         "complained": 0,
 *         "notSent": 0
 *       }, 
 *       {
 *       "campaignId": "ea46013c-bf9f-4617-ad5d-9247bcg0837",
 *       "landingPage": {
 *          "opened": 10,
 *          "clicked": 10
 *         },
 *         "email": {
 *           "delivered": 55,
 *           "opened": 42,
 *           "clicked": 13,
 *           "bounced": 1,
 *           "complained": 0,
 *           "notSent": 0
 *         } 
 *      }
 *   ]
 * }
 */

```

### Retrieves a list of statistics for up to 100 selected campaigns (with elevated permissions)
```javascript
import { campaigns } from '@wix/email-marketing';
import { auth } from '@wix/essentials';

const elevatedListStatistics = auth.elevate(campaigns.listStatistics);

// Sample campaignIds = ['ea46013c-bbbf-4617-ad5d-9247bc4c0970', 'ea46013c-bb6f-4617-ad5d-9247bc4g5478', 'ea46013c-bf9f-4617-ad5d-9247bcg0837'];

export async function listStatistics(campaignIds) {
  try {
    const results = await elevatedListStatistics(campaignIds);

    console.log("Success! Your statistics are listed.")
    return results;
  } catch (error) {
    console.error(error);
  }
}

/* Promise resolves to:
 * {
 *   "statistics": [
 *     {
 *       "campaignId": "ea46013c-bbbf-4617-ad5d-9247bc4c0970",
 *       "landingPage": {
 *         "opened": 0,
 *         "clicked": 0
 *     },
 *       "email": {
 *         "delivered": 1,
 *         "opened": 1,
 *         "clicked": 0,
 *         "bounced": 0,
 *         "complained": 0,
 *         "notSent": 0
 *     },
 *     {
 *       "campaignId": "ea46013c-bb6f-4617-ad5d-9247bc4g5478",
 *       "landingPage": {
 *         "opened": 8,
 *         "clicked": 12
 *       },
 *       "email": {
 *         "delivered": 35,
 *         "opened": 22,
 *         "clicked": 15,
 *         "bounced": 0,
 *         "complained": 0,
 *         "notSent": 0
 *       }, 
 *       {
 *       "campaignId": "ea46013c-bf9f-4617-ad5d-9247bcg0837",
 *       "landingPage": {
 *          "opened": 10,
 *          "clicked": 10
 *         },
 *         "email": {
 *           "delivered": 55,
 *           "opened": 42,
 *           "clicked": 13,
 *           "bounced": 1,
 *           "complained": 0,
 *           "notSent": 0
 *         } 
 *      }
 *   ]
 * }
 */
```

### listStatistics (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 { campaigns } from '@wix/email-marketing';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { campaigns },
  // Include the auth strategy and host as relevant
});


async function listStatistics(campaignIds) {
  const response = await myWixClient.campaigns.listStatistics(campaignIds);
};
```

---