listStatistics( )
Retrieves a list of statistics for up to 100 selected campaigns.
Description
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.
Use List Campaigns to retrieve additional information for your campaigns. Use List Recipients to retrieve a list of recipients and their activities related to a selected campaign.
This function is not a universal function and runs only on the backend.
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function listStatistics(campaignIds: Array<string>): Promise<ListStatisticsResponse>
listStatistics Parameters
NAME
TYPE
DESCRIPTION
IDs of the campaigns to retrieve.
Max: 100 campaigns
Returns
Return Type:
NAME
TYPE
DESCRIPTION
List of statistics.
Was this helpful?
Retrieves a list of statistics for up to 100 selected campaigns
1import { campaigns } from 'wix-email-marketing.v2';23// Sample campaignIds = ['ea46013c-bbbf-4617-ad5d-9247bc4c0970', 'ea46013c-bb6f-4617-ad5d-9247bc4g5478', 'ea46013c-bf9f-4617-ad5d-9247bcg0837'];45export async function listStatistics(campaignIds) {6 try {7 const results = await campaigns.listStatistics(campaignIds);89 console.log("Success! Your statistics are listed.")10 return results;11 } catch (error) {12 console.error(error);13 }14}1516/* Promise resolves to:17 * {18 * "statistics": [19 * {20 * "campaignId": "ea46013c-bbbf-4617-ad5d-9247bc4c0970",21 * "landingPage": {22 * "opened": 0,23 * "clicked": 024 * },25 * "email": {26 * "delivered": 1,27 * "opened": 1,28 * "clicked": 0,29 * "bounced": 0,30 * "complained": 0,31 * "notSent": 032 * },33 * {34 * "campaignId": "ea46013c-bb6f-4617-ad5d-9247bc4g5478",35 * "landingPage": {36 * "opened": 8,37 * "clicked": 1238 * },39 * "email": {40 * "delivered": 35,41 * "opened": 22,42 * "clicked": 15,43 * "bounced": 0,44 * "complained": 0,45 * "notSent": 046 * },47 * {48 * "campaignId": "ea46013c-bf9f-4617-ad5d-9247bcg0837",49 * "landingPage": {50 * "opened": 10,51 * "clicked": 1052 * },53 * "email": {54 * "delivered": 55,55 * "opened": 42,56 * "clicked": 13,57 * "bounced": 1,58 * "complained": 0,59 * "notSent": 060 * }61 * }62 * ]63 * }64 */65