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.
Authorization
Request
This endpoint does not take any parameters
Response Object
NAME
TYPE
DESCRIPTION
List of statistics.
Status/Error Codes
Was this helpful?
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
1import { Permissions, webMethod } from 'wix-web-module';2import { campaigns } from 'wix-email-marketing.v2';34// Sample campaignIds = ['ea46013c-bbbf-4617-ad5d-9247bc4c0970', 'ea46013c-bb6f-4617-ad5d-9247bc4g5478', 'ea46013c-bf9f-4617-ad5d-9247bcg0837'];56export const listStatistics = webMethod(Permissions.Anyone, async (campaignIds) => {7 try {8 const results = await campaigns.listStatistics(campaignIds);910 console.log("Success! Your statistics are listed.")11 return results;12 } catch (error) {13 console.error(error);14 }15});1617/* Promise resolves to:18 * {19 * "statistics": [20 * {21 * "campaignId": "ea46013c-bbbf-4617-ad5d-9247bc4c0970",22 * "landingPage": {23 * "opened": 0,24 * "clicked": 025 * },26 * "email": {27 * "delivered": 1,28 * "opened": 1,29 * "clicked": 0,30 * "bounced": 0,31 * "complained": 0,32 * "notSent": 033 * },34 * {35 * "campaignId": "ea46013c-bb6f-4617-ad5d-9247bc4g5478",36 * "landingPage": {37 * "opened": 8,38 * "clicked": 1239 * },40 * "email": {41 * "delivered": 35,42 * "opened": 22,43 * "clicked": 15,44 * "bounced": 0,45 * "complained": 0,46 * "notSent": 047 * },48 * {49 * "campaignId": "ea46013c-bf9f-4617-ad5d-9247bcg0837",50 * "landingPage": {51 * "opened": 10,52 * "clicked": 1053 * },54 * "email": {55 * "delivered": 55,56 * "opened": 42,57 * "clicked": 13,58 * "bounced": 1,59 * "complained": 0,60 * "notSent": 061 * }62 * }63 * ]64 * }65 */66