Campaign statistics
Print
Modified on: Tue, 11 Jun, 2019 at 3:23 PM
GET /api/campaign.php
Request parameters
All parameters must be provided as query arguments, and values must be URL-encoded.
Parameter | Value |
id | Unique ID of campaign, which is returned on launch. Can be found with Campaign list API request. Required.
|
detailed | Include recipents detailed opens/clicks statistics with response. Value can be either 0 or 1.
|
offset | So-called “page” number, which begins at 0. 0 gives contacts from 0 to 10000. 1 gives 10001 to 20000 etc. If not specified, 0 will be set.
|
limit | Number of subscribers on one “page”. If not specified, 10000 will be set, which is also the maximum value. If set as more than 10000, no error will be given, but the value will be defaulted back to 10000.
|
Note! Parameters offset and limit are only applied when detailed parameter has value of 1.
Response payload
Field | Value |
id | Unique ID of campaign.
|
name | Campaign title.
|
google_analytics_tracking | Google Analytics tracking settings. See "Field google_analytics_tracking structure" for more information.
|
total_count | Total number of campaign messages.
|
delivered_count | Number of messages successfully delivered.
|
bounce_count | Number of messages bounced.
|
click_count | Number of link clicks.
|
unique_click_count | Number of recipients who have clicked at least one link.
|
click_percent | Percentage of recipients who have clicked at least one link. unique_click_count divided by delivered_count.
|
view_count | Number of times message images were downloaded.
|
unique_view_count | Number of recipients who have downloaded images at least one time.
|
view_percent | Percentage of recipients who have downloaded images at least one time. unique_view_count divided by delivered_count.
|
opened_count | Number of recipients who have opened the messages (clicked a link or downloaded images at least once).
|
opened_percent | Percentage of recipients who have opened the message. opened_count divided by delivered_count.
|
unsubscribe_count | Number of unsubscribed recipients.
|
complaint_count | Number of recipients who reported message as spam.
|
forward_count | Number of times message was forwarded.
|
addresses | List of detailed statistics per recipient. Added only when request parameter detailed is 1. See "Field addresses structure" section for more information.
|
Field google_analytics_tracking structure
Field | Value |
enabled | Google Analytics tracking enabled status.
|
utm_campaign | Google Analytics utm_campaign parameter value. Is NULL if not set.
|
Field addresses structure
Field | Value |
email | Recipients email address.
|
sent_at | Message delivery date and time. Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
|
opens | Number of times recipient opened message.
|
clicks | Number of times recipient clicked link(s).
|
links | List of links clicked by recipient. See "Field links structure" for more information.
|
Field links structure
Field | Value |
href | Link's URL.
|
visit_at | Date and time of first click. Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
|
count | Number of times link has been clicked.
|
Example request
$username = 'YOUR_USERNAME';
$password = 'YOUR_PASSWORD';
$location = 'https://<subdomain>.sendsmaily.net/api/campaign.php';
$query = 'id=1&detailed=1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $location . '?' . $query);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$result = curl_exec($ch);
curl_close($ch);
Example response
{
"id": "5",
"name": "My First Campaign",
"google_analytics_tracking": {
"enabled": true,
"utm_campaign": "201903_spring_campaign"
},
"total_count": 10445,
"delivered_count": 10400,
"bounce_count": 45,
"click_count": 330,
"unique_click_count": 123,
"click_percent": 1.18,
"view_count": 3220,
"unique_view_count": 2765,
"view_percent": 26.59,
"opened_count": 2833,
"opened_percent": 27.24,
"unsubscribe_count": 3,
"complaint_count": 0,
"forward_count": 0,
"addresses": [
{
"email": "support@smaily.com",
"sent_at": "2019-03-10 11:34:15",
"opens": 3,
"clicks": 1,
"links": [
{
"href": "https://smaily.com",
"visit_at": "2019-03-10 13:07:11",
"count": 1
}
]
},
...
]
}
Did you find it helpful?
Yes
No
Send feedback Sorry we couldn't be helpful. Help us improve this article with your feedback.