Get an email campaign stats report listing email campaign performance tracking statistics for one or more campaigns.

Note: This method is only for use with primary_email and resend role email campaign activities.

Make a GET call to the /reports/stats/email_campaigns/{campaign_ids} endpoint to get email campaign performance tracking statistics for one or more campaigns. Statistics include the total number of times contacts interacted with your campaigns and how. For example, stats include totals for each device type contacts used to open the campaign and the type of interactions they had with the campaign, such as clicking on a link or forwarding it to another email address.

For each campaign_id, this method returns the total counts (stats) for each type of tracked email and relevant campaign-related percentages (percents) . It also returns the date and time at which the campaign stats were last refreshed. If any campaign_id is invalid, a 404 error response is returned for all campaigns.

The following shows example response results for a single campaign_id:

 {
   "errors": [],
   "results": [
     {
       "campaign_id": "d47a2d25-16a9-44a6-a8c0-5732dcb4712g",
       "stats": {
         "em_bounces": 0,
         "em_clicks": 1,
         "em_clicks_all": 1,
         "em_clicks_all_computer": 1,
         "em_clicks_all_mobile": 0,
         "em_clicks_all_tablet": 0,
         "em_clicks_all_other": 0,
         "em_clicks_all_none": 0,
         "em_forwards": 0,
         "em_not_opened": 0,
         "em_opens": 1,
         "em_opens_all": 1,
         "em_opens_all_computer": 1,
         "em_opens_all_mobile": 0,
         "em_opens_all_tablet": 0,
         "em_opens_all_other": 0,
         "em_opens_all_none": 0,
         "em_optouts": 0,
         "em_sends": 1
       },
       "percents": {
         "bounce": 0,
         "click": 100,
         "desktop_click": 100,
         "desktop_open": 100,
         "did_not_open": 0,
         "mobile_click": 0,
         "mobile_open": 0,
         "open": 100,
         "unsubscribe": 0
       },
       "last_refresh_time": "2021-05-25T18:21:15.066Z"
     }
   ]
 }
  • stats : Key-value pairs of campaign related statistics.
    • em_bounces : Number of unique email bounces.

    • em_clicks : Number of unique recipients who clicked any link in the email.

    • em_clicks_all : Total number of non-unique email clicks.

    • em_clicks_all_computer : Number of non-unique email clicks on a standard desktop or laptop computer.

    • em_clicks_all_mobile : Number of non-unique email clicks on a mobile phone or similar small mobile device (e.g. iPhone).

    • em_clicks_all_tablet: Number of non-unique email clicks on a small tablet type computer (e.g. iPad).

    • em_clicks_all_other : Number of non-unique email clicks on an unknown device (e.g. Game Console or Wearable).

    • em_clicks_all_none : Number of non-unique email clicks for which the device type was not captured. This will account for any clicks prior to when device type was collected and stored.

    • em_forwards: Number of unique recipients who forwarded the email using the forward to a friend feature (not available for all types of emails).

    • em_not_opened : Number of unique recipients who did not open the email. This is calculated as follows: em_not_opened is equal to em_sends - em_opens - em_bounces. This value is reported as zero if the calculation results in a negative value.

    • em_opens : Number of unique recipients who opened the email.

    • em_opens_all : Total number of non-unique email opens.

    • em_opens_all_computer : Number of non-unique email opens on a standard desktop or laptop computer.

    • em_opens_all_mobile: Number of non-unique email opens on a mobile phone or similar small mobile device (e.g. iPhone).

    • em_opens_all_tablet: Number of non-unique email opens on a small tablet type computer (e.g. iPad).

    • em_opens_all_other: Number of non-unique email opens on an unknown device (e.g. Game Console or Wearable).

    • em_opens_all_none: Number of non-unique email opens for which the device type was not captured. This will account for any opens prior to when device type was collected and stored.

    • em_optouts: Number of unique recipients who unsubscribed due to this email.

    • em_sends: Number of unique email sends.

  • percents : Key-value pairs of campaign related percentages.
    • bounce : Percentage of emails sent to unique recipients that bounced.

    • click: Percentage of recipients who opened the email who also clicked one or more links in it.

    • desktop_click: Percentage of clicks that came from a standard desktop or laptop computer.

    • desktop_open: Percentage of opens that came from a standard desktop or laptop computer.

    • did_not_open: Percentage of recipients that received the email (did not bounce) but did not open it.

    • mobile_click: Percentage of clicks that came from a mobile phone, tablet computer, or similar small mobile device (e.g. iPhone or iPad).

    • mobile_open: Percentage of opens that came from a mobile phone, tablet computer, or similar small mobile device (e.g. iPhone or iPad).

    • open: Percentage of recipients that received the email (did not bounce) and opened it.

    • unsubscribe: Percentage of recipients that received the email (did not bounce) and chose to unsubscribe.

  • last_refresh_time : By default, the report shows statistics captured since the last scheduled refresh date for each email campaign.

Parameters

To get email campaign statistics for one or more email campaigns, specify each campaign_id using the campaign_ids URL query parameter.

Example GET Email Campaign Stats Report

GET https://api.cc.email/v3/reports/stats/{campaign_ids}

Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: campaign_data

<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/reports/stats/{campaign_ids}');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'url_id' => '499207421663'
));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'Accept-Encoding' => 'gzip, deflate',
  'Host' => 'host_name.com',
  'Cache-Control' => 'no-cache',
  'User-Agent' => 'PostmanRuntime/7.15.2',
  'Authorization' => 'Bearer {access_token}',
  'Content-Type' => 'application/json',
  'Accept' => '*/*'
));

try {
  $response = $request->send();
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/reports/stats/{campaign_ids}")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "*/*")
  .addHeader("Authorization", "Bearer {access_token}")
  .build();

Response response = client.newCall(request).execute();

curl -X GET \
  https://api.cc.email/v3/reports/stats/{campaign_ids} \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json' \

Response

{
   "errors": [],
   "results": [
     {
       "campaign_id": "d47a2d25-16a9-44a6-a8c0-5732dcb4712g",
       "stats": {
         "em_bounces": 0,
         "em_clicks": 1,
         "em_clicks_all": 1,
         "em_clicks_all_computer": 1,
         "em_clicks_all_mobile": 0,
         "em_clicks_all_tablet": 0,
         "em_clicks_all_other": 0,
         "em_clicks_all_none": 0,
         "em_forwards": 0,
         "em_not_opened": 0,
         "em_opens": 1,
         "em_opens_all": 1,
         "em_opens_all_computer": 1,
         "em_opens_all_mobile": 0,
         "em_opens_all_tablet": 0,
         "em_opens_all_other": 0,
         "em_opens_all_none": 0,
         "em_optouts": 0,
         "em_sends": 1
       },
       "percents": {
         "bounce": 0,
         "click": 100,
         "desktop_click": 100,
         "desktop_open": 100,
         "did_not_open": 0,
         "mobile_click": 0,
         "mobile_open": 0,
         "open": 100,
         "unsubscribe": 0
       },
       "last_refresh_time": "2021-05-25T18:21:15.066Z"
     }
   ]
 }


Try it!