Get a Clicks Report for an Email Campaign Activity
Note: This method is only for use with primary_email and resend role email campaign activities.
Make a GET call to the /reports/email_reports/{campaign_activity_id}/tracking/clicks endpoint to get an email clicks report listing contacts that clicked URL links in an email campaign activity.
By default, the email clicks report lists the date and time each contact clicked the URL link with the most recent activity listed first. This report also includes basic contact information including the type of device the contact used when clicking the URL link (computer, mobile, tablet, or other).
The following example shows properties that the email clicks report returns:
{
"contact_id": "a2fdc285-f4bc-408c-9e64-f3f89038ec82",
"campaign_activity_id": "98edac88-f4bc-408c-9e64-acd890384231",
"tracking_activity_type": "em_clicks",
"email_address": "maddieb@gmail.com",
"first_name": "Maddie",
"last_name": "Brown",
"device_type": "computer",
"url_id": "1100407204171",
"link_url": "http://www.yoursite.com",
"created_time": "2019-04-25T11:08:00.000Z",
}If you have not sent the email campaign activity to contacts, this method returns a successful 200 response code and an empty tracking_activities array. For example:
{
"tracking_activities": []
}You can confirm that Constant Contact successfully sent an email campaign activity by making a GET call to /emails/activities/{campaign_activity_id} and checking that the email campaign activity has a status of Done. For more information, see the Get an Email Campaign Activity topic.
Parameters
This method requires the campaign_activity_id URL parameter of the email campaign activity for which you want to get an email clicks report. By default, the clicks report returns a list of all clicked links and each link is uniquely identified (url_id). To get an email clicks report for a single URL link, use the url_id query parameter.
To limit the number of email clicks activities to return on each page, use the limit query parameter.
Example GET Email Clicks Report Call
This example GET call returns an email clicks report for a specified email campaign activity.
https://api.cc.email/v3/reports/email_reports/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/clicksEndpoint Requirements
User privileges: ui:campaign:metricsAuthorization scopes: campaign_dataOkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.cc.email/v3/reports/email_reports/6cc0d637-cf3d-4ac6-aad7-21567698eb38/tracking/clicks")
.get()
.addHeader("Accept", "*/*")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer {access_token}")
.addHeader("User-Agent", "PostmanRuntime/7.15.2")
.addHeader("Cache-Control", "no-cache")
.addHeader("Postman-Token", "993474d5-faee-485c-9e88-7896037ee794,68bebe14-8e5c-4816-b1be-d759def467f7")
.addHeader("Host", "host_name.com")
.addHeader("Accept-Encoding", "gzip, deflate")
.addHeader("Connection", "keep-alive")
.addHeader("cache-control", "no-cache")
.build();
Response response = client.newCall(request).execute();Response
{
"tracking_activities": [
{
"contact_id": "4399ce90-5b89-11e7-ba80-00163e498a38",
"campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
"tracking_activity_type": "em_clicks",
"email_address": "contact01@gmail.com",
"device_type": "other",
"url_id": "499207421663",
"link_url": "http://tracking_summary_stats_new_data_2campaign.com/",
"created_time": "2019-05-16T21:14:00.000Z"
},
{
"contact_id": "4399f5a0-5b89-11e7-ba80-00163e498a38",
"campaign_activity_id": "c8cdf384-15ca-4dcc-9b6f-4c91121fdc23",
"tracking_activity_type": "em_clicks",
"email_address": "contact02@gmail.com",
"device_type": "mobile",
"url_id": "499207421663",
"link_url": "http://tracking_summary_stats_new_data_2campaign.com/",
"created_time": "2019-05-16T21:14:00.000Z"
}
]
}