Note: This method is only for use with primary_email
and resend
role email campaign activities. The email campaign activity must have a current_status
of DONE
(you successfully sent the email campaign to contacts). To view the role
and current_status
for an email campaign activity, make a GET call to the emails/activities/{campaign_activity_id}
endpoint.
Make a GET call to the /reports/stats/email_campaign_activities/{campaign_activity_ids}
endpoint to get email tracking statistics for one to ten email campaign activities.
The following example shows the resulting email tracking statistics for two email campaign activities (campaign_activity_ids
):
{
"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": "2020-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 Constant Contact fails to retrieve stats for one or more activities due to a system error, this method returns an errors
object that indicates which campaign activities failed. 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"
}
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 statistics 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
Get campaign activity statistics for one or more email campaign activities (a maximum of 10), specify the campaign activity IDs (comma separated). For example:
`/reports/stats/email_campaign_activities/1dd44181-8b89-4c36-867a-b3490f373659,34000e59-fc4a-488c-855f-d5c74bf10701`
Examples
GET https://api.cc.email/v3/reports/stats/email_campaign_activities/{campaign_activity_ids}
Endpoint Requirements
User privileges: ui:campaign:metrics
Authorization scopes: campaign_data
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.cc.email/v3/reports/stats/email_campaign_activities/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Accept: */*',
'Authorization: Bearer {access_token}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api.cc.email/v3/reports/stats/email_campaign_activities/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23")
.method("GET", null)
.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/email_campaign_activities/c8cdf123-15ca-4dcc-9b6f-4c91121fdc23 \
-H 'Accept: */*' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'
Response
{
"errors": [],
"results": [
{
"campaign_id": "cd0037ad-779a-4b3f-9161-43f062c6dd70",
"campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
"campaign_activity_type": 10,
"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": "2020-09-25T16:11:36.000Z"
}
]
}