Summary Analytics

Getting Started

Introduction

This endpoint is used to fetch analytics summary in the defined date range. In which response objects is having date, subscriber_count, desktop_subscriber_count, mobile_subscriber_count, unsubscribed_count,desktop_unsubscribed_count, mobile_unsubscribed_count, notification_sent, net_subscriber_sent, view_count, click_count, ctr.

Getting Summary Analytics

Request URL

https://api.pushengage.com/apiv1/analytics/summary
Method

GET
Request Parameters

Required Parameters

Parameter Name Parameter Type Description
from Date The date from which user want summary analytics in ISO861 format (YYYY-MM-DD).
to Date The date till the user wants summary analytics in in ISO861 format.
group_by String The analytics will be fetched by groups as (days, week, month)

Response Objects

Property Name Property Type Description
success Boolean Indicates analytics summary request succeeded or not. Value can be 'true' or 'false'.
date String Indicates the date range of summary analytics.
subscriber_count Number Total number of new subscribers.
desktop_subscriber_count Number Total number of new desktop subscribers.
mobile_subscriber_count Number Total number of new mobile subscribers.
unsubscribed_count Number Total number of unsubscribed.
desktop_unsubscribed_count Number Total number of subscribers who unsubscribed from the desktop.
mobile_unsubscribed_count Number Total number of subscribers who unsubscribed from the mobile.
notification_sent Number Total number of notification sent.
net_subscriber_sent Number Total number of notification sent to subscribers.
view_count Number Total number of notification viewed.
click_count Number Total number of notification clicked.
ctr Number Click Through Rate (click_count/view_count*100).

Example

Request

curl -X GET \
  'https://api.pushengage.com/apiv1/analytics/summary?from=2019-01-01&to=2019-04-01&group_by=day' \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Api_key: <your_pushengage_api_key>' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.pushengage.com/apiv1/analytics/summary?from=2019-01-01&to=2019-04-01&group_by=day",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Accept: */*",
    "Accept-Encoding: gzip, deflate",
    "Api_key: <your_pushengage_api_key>",
    "Cache-Control: no-cache",
    "Connection: keep-alive",
    "Content-Type: application/json",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>

Response

{
  "success": true,
  "data": [
        {
            "date": "2019-01-01",
            "subscriber_count": 10207,
            "desktop_subscriber_count": 1618,
            "mobile_subscriber_count": 8589,
            "unsubscribed_count": 9211,
            "desktop_unsubscribed_count": 1497,
            "mobile_unsubscribed_count": 7714,
            "notification_sent": 7256,
            "net_subscriber_sent": 11802527,
            "view_count": 5369622,
            "click_count": 118196,
            "ctr": 2.2
        }
    ]
}
{
  "success": false,
  "message": "API KEY Invalid"
}
{
  "success": false,
  "error": {
        "name": "InvalidRequestException",
        "message": "Error Message"
    }
}