Get a report listing contacts that clicked URL links in a specified 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.

Query Parameters

This method does not currently support filtering results using the email clicks report created_time timestamp.

Example GET Email Clicks Report Call

This example GET call returns an email clicks report for a specified email campaign activity.

GET https://api.cc.email/v3/reports/email_reports/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/clicks

Endpoint Requirements

User privileges: ui:campaign:metrics

Authorization scopes: campaign_data

<?php
$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/reports/email_reports/c8cdf384-15ca-4dcc-9b6f-4c91121fdc23/tracking/clicks');
$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',
  'Postman-Token' => '993474d5-faee-485c-9e88-7896037ee794,86ee68d5-c255-4842-a2f6-b349275178e7',
  '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/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();
curl -X GET \
  'https://api.cc.email/v3/reports/email_reports/6cc0d637-cf3d-4ac6-aad7-21567698eb38/tracking/clicks' \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: host_name.com' \
  -H 'Postman-Token: 993474d5-faee-485c-9e88-7896037ee794,ef35d635-0f78-48ad-a464-c164518cff35' \
  -H 'User-Agent: PostmanRuntime/7.15.2' \
  -H 'cache-control: no-cache'

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"
        }
    ]
}


Try it!