> 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 # 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, you receive the total activity count for the campaign's landing page and email. For example, the total amount of times the landing page was opened, or the total amount of email recipients that clicked a link in an email. Call List Campaigns to retrieve additional information for a site's campaigns. Call List Recipients to retrieve a list of recipients and their activities related to a selected campaign. --- ## REST API ### Schema ``` Method: listStatistics Description: Retrieves a list of statistics for up to 100 selected campaigns. For each campaign, you receive the total activity count for the campaign's landing page and email. For example, the total amount of times the landing page was opened, or the total amount of email recipients that clicked a link in an email. Call List Campaigns to retrieve additional information for a site's campaigns. Call List Recipients to retrieve a list of recipients and their activities related to a selected 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 | description: IDs of the campaigns to retrieve (max 100 campaigns). | required: true Return type: ListStatisticsResponse - name: statistics | type: array | description: List of statistics. - name: campaignId | type: string | description: Campaign GUID. - name: landingPage | type: LandingPageStatistics | description: Landing page statistics. - name: opened | type: integer | description: Number of times when a 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. - 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 a spam. - name: notSent | type: integer | description: Number of emails that weren't sent due to the campaign termination. ``` ### 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: ' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.emailMarketing.CampaignStatisticsService.listStatistics(campaignIds) Description: Retrieves a list of statistics for up to 100 selected campaigns. For each campaign, you receive the total activity count for the campaign's landing page and email. For example, the total amount of times the landing page was opened, or the total amount of email recipients that clicked a link in an email. Call List Campaigns to retrieve additional information for a site's campaigns. Call List Recipients to retrieve a list of recipients and their activities related to a selected 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 | description: IDs of the campaigns to retrieve (max 100 campaigns). | required: true Return type: PROMISE - name: statistics | type: array | description: List of statistics. - name: campaignId | type: string | description: Campaign GUID. - name: landingPage | type: LandingPageStatistics | description: Landing page statistics. - name: opened | type: integer | description: Number of times when a 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. - 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 a spam. - name: notSent | type: integer | description: Number of emails that weren't sent due to the campaign termination. ``` ### 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-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 { 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); }; ``` ---