Get a report showing statistics for one or more email campaign activities.

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

Make a GET call to the /reports/summary_reports/{campaign_activity_ids}/campaign_activity_stats endpoint to get tracking activity statistics for one to ten email campaign activities.

The following example shows the resulting email tracking activity counts for two email campaign activities (campaign_activity_ids) when specified in the URL query parameter (comma separated):

 {
     "errors": [],
     "results": [
         {
             "campaign_id": "d5ba893d-1f41-4590-9953-b6fea69fbd78",
             "campaign_activity_id": "1dd44181-8b89-4c36-867a-b3490f373659",
             "stats": {
                 "em_clicks": 2,
                 "em_opens.all.mobile": 3,
                 "em_clicks.all.none": 0,
                 "em_bounces": 6,
                 "em_clicks.all": 2,
                 "em_opens.all.computer": 0,
                 "em_abuse": 0,
                 "em_clicks.all.mobile": 2,
                 "em_bounces_blocked": 1,
                 "em_bounces_other": 1,
                 "em_opens": 6,
                 "em_opens.all": 6,
                 "em_clicks.all.computer": 0,
                 "em_opens.all.other": 3,
                 "em_not_opened": 3,
                 "em_bounces_nonexistent_address": 1,
                 "em_bounces_suspended": 0,
                 "em_opens.all.none": 0,
                 "em_clicks.all.tablet": 0,
                 "em_sends": 15,
                 "em_optouts": 1,
                 "em_forwards": 1,
                 "em_bounces_undeliverable": 1,
                 "em_opens.all.tablet": 0,
                 "em_bounces_mailbox_full": 1,
                 "em_clicks.all.other": 0,
                 "em_bounces_vacation": 1
             },
             "last_refresh_time": "2019-09-24T16:26:56.000Z"
         },
         {
             "campaign_id": "421c1f96-f76a-462a-84b8-fcc4f56bc548",
             "campaign_activity_id": "34000e59-fc4a-488c-855f-d5c74bf10701",
             "stats": {
                 "em_clicks": 2,
                 "em_opens.all.mobile": 3,
                 "em_clicks.all.none": 0,
                 "em_bounces": 6,
                 "em_clicks.all": 2,
                 "em_opens.all.computer": 1,
                 "em_abuse": 0,
                 "em_clicks.all.mobile": 1,
                 "em_bounces_blocked": 1,
                 "em_bounces_other": 1,
                 "em_opens": 6,
                 "em_opens.all": 6,
                 "em_clicks.all.computer": 0,
                 "em_opens.all.other": 2,
                 "em_not_opened": 3,
                 "em_bounces_nonexistent_address": 1,
                 "em_bounces_suspended": 0,
                 "em_opens.all.none": 0,
                 "em_clicks.all.tablet": 0,
                 "em_sends": 15,
                 "em_optouts": 1,
                 "em_forwards": 1,
                 "em_bounces_undeliverable": 1,
                 "em_opens.all.tablet": 0,
                 "em_bounces_mailbox_full": 1,
                 "em_clicks.all.other": 1,
                 "em_bounces_vacation": 1
             },
             "last_refresh_time": "2019-10-01T13:49:26.000Z"
         
         }
 
    ]
}

The results are sorted in descending order by last_refresh_date (the date and time in ISO format that the email campaign activity was last refreshed).

When requesting statistics for multiple email campaign activities, if one or more of the campaign_activity_ids that you specify in the URL query parameter do not exist, are invalid, were deleted, or do not have any stats associated with it, the campaign_activity_ids and error details display under errors. For example:

"errors": [
        {
            "error_key": "reporting.partial_success",
            "error_message": "Failed to retrieve campaign activity stats for the following campaign activities: c8cff384-15ca-4dcc-9b6f-4c91121fde24"
        }

If all campaign_activity_ids do not exist, are invalid, or do not have statistics associated with it, a 404 error response is returned. For example, statistics do not exist for email campaign activities that have a current_status of DRAFT, SCHEDULED but never sent, ERROR, or REMOVED. To view the current_status for an email campaign activity, make a GET call to the emails/activities/{campaign_activity_id} endpoint.

Statistics

Depending on the email campaign tracking activity type, the total counts returned are either unique (basic tracking or bounces activity) or non-unique (by device).

Unique Counts

Unique counts help to provide you with more meaningful statisics about how an email campaign activity is performing. For each email campaign activity that you specify and for each related email campaign tracking activity with which a contact interacts, only the first interaction is counted. For example, if the same contact opens your email campaign activity twice, the unique count is 1 not 2.

Basic email campaign tracking activities include:

  • em_sends
  • em_opens
  • em_clicks
  • em_bounces
  • em_optouts
  • em_forwards
  • em_abuse (spam)
  • em_not_opened

Bounce-related email campaign tracking activities include:

  • em_bounces_nonexistent_address
  • em_bounces_blocked
  • em_bounces_mailbox_full
  • em_bounces_vacation
  • em_bounces_suspended
  • em_bounces_undeliverable
  • em_bounces_other

Non-unique Device Counts

Non-unique counts show you which device a contact used and the number of times they used it to open or click on each specified email campaign activity.

  • em_opens.all
  • em_opens.all.none
  • em_opens.all.other
  • em_opens.all.computer
  • em_opens.all.mobile
  • em_opens.all.tablet
  • em_clicks.all
  • em_clicks.all.none
  • em_clicks.all.other
  • em_clicks.all.computer
  • em_clicks.all.mobile
  • em_clicks.all.tablet

Parameters

To get campaign activity statistics for one or more email campaign activities (a maximum of 10), use the URL query parameter to specify each campaign_activity_ids (comma separated). For example:

`/reports/summary_reports/1dd44181-8b89-4c36-867a-b3490f373659,34000e59-fc4a-488c-855f-d5c74bf10701/campaign_activity_stats`

Examples

GET https://api.cc.email/v3/reports/summary_reports/{campaign_activity_ids}/campaign_activity_stats

Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: campaign_data

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/reports/summary_reports/c8cdf123-15ca-4dcc-9b6f-4c91121fdc23/campaign_activity_stats');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Authorization' => 'Bearer {access_token}',
  'Accept' => '*/*',
  'Content-Type' => 'application/json'
));

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

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/reports/summary_reports/c8cdf123-15ca-4dcc-9b6f-4c91121fdc23/campaign_activity_stats")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "*/*")
  .addHeader("Authorization", "Bearer {access_token}")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
curl -X GET \
  https://api.cc.email/v3/reports/summary_reports/c8cdf123-15ca-4dcc-9b6f-4c91121fdc23/campaign_activity_stats \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache'

Response

{
    {
        "errors": [],
        "results": [
            {
                "campaign_id": "cd000000-779a-4b3f-9161-43f062c6dd70",
                "campaign_activity_id": "c8cdf123-15ca-4dcc-9b6f-4c91121fdc23",
                "stats": {
                    "em_clicks": 2,
                    "em_opens.all.mobile": 2,
                    "em_clicks.all.none": 0,
                    "em_bounces": 6,
                    "em_clicks.all": 2,
                    "em_opens.all.computer": 1,
                    "em_abuse": 0,
                    "em_clicks.all.mobile": 1,
                    "em_bounces_blocked": 1,
                    "em_bounces_other": 1,
                    "em_opens": 6,
                    "em_opens.all": 6,
                    "em_clicks.all.computer": 0,
                    "em_opens.all.other": 3,
                    "em_not_opened": 3,
                    "em_bounces_nonexistent_address": 1,
                    "em_bounces_suspended": 0,
                    "em_opens.all.none": 0,
                    "em_clicks.all.tablet": 0,
                    "em_sends": 15,
                    "em_optouts": 1,
                    "em_forwards": 1,
                    "em_bounces_undeliverable": 1,
                    "em_opens.all.tablet": 0,
                    "em_bounces_mailbox_full": 1,
                    "em_clicks.all.other": 1,
                    "em_bounces_vacation": 1
                },
                "last_refresh_time": "2019-10-01T18:05:23.000Z"
            }
        ]
    }

Try it!