Statistics API

Content

Introduction

The Statistics API is designed to help you synchronously access all story, campaign & message statistics performance data available in ActivatePro.

Versioning

The versions of our different endpoints are defined in the header X-XNG-ApiVersion. To use this API please provide version 2.

Authentication

ActivatePro uses header authentication. To get your API key, please log into the app and navigate to Settings. You will find the value in the System setup -> API keys section in the Public API key. For example:

  • X-XNG-AuthToken: 3fe00023932f9903

Date format

Dates and times are expressed in ISO8601 format in UTC (Coordinated Universal Time), with a special UTC designator ("Z") For more information please check here.

Error handling

When exporting data from ActivatePro, please use the below practices related to error handling:

Resume or retry uploads that fail due to connection interruptions or any 5xx errors, including:

  • 500 Internal Server Error
  • 502 Bad gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout

How to retry requests made to ActivatePro in case of errors:

  • Use an exponential backoff strategy if any 5xx server error is returned when retrying export requests. These errors can occur if a server is getting overloaded. Exponential backoff can help alleviate these kinds of problems during periods of high volume of requests or heavy network traffic.
  • Other kinds of requests should not be handled by exponential backoff but you can still retry a number of them. When retrying these requests, limit the number of times you retry them. For example your code could limit to ten retries or less before reporting the error to our team for investigation.

Reference

KPI management

Get all KPIs

URL:

GET https://api.crossengage.io/statistics/kpi

Request

Headers

Content-Type:application/json
X-XNG-ApiVersion:2
X-XNG-AuthToken:Your API Key
Parameters  
id

id of a KPI

Example: 234.

String

Response

Attributes  
id
string
213
name enum (details see KPI names)
formula enum (details see Formula)
type Possible:
INTEGER, PERCENTAGE
createdAt 2015-08-05T08:40Z
updatedAt 2015-08-05T08:40Z

200

Headers

Content-Type:application/json

Body

[
  {
    "id": "213",
    "name": "Conversion to View Rate",
    "formula": "CONVERSION / UNIQUE VIEWED * 100",
    "type": "PERCENTAGE",
    "createdAt": "2015-08-05T08:40Z",
    "updatedAt": "2015-08-05T08:40Z"
  }
]

Use this endpoint to get all of the KPIs available on your account and their details.

Get a certain KPI

URL:

GET https://api.crossengage.io/statistics/kpi

Request

Headers

Content-Type:application/json
X-XNG-ApiVersion:2
X-XNG-AuthToken:Your API Key

Response

Attributes  
id
string
213
name enum (details see KPI names)
formula enum (details see Formula)
type Possible:
INTEGER, PERCENTAGE
createdAt 2015-08-05T08:40Z
updatedAt 2015-08-05T08:40Z

200

Headers

Content-Type:application/json

Body

{
  "id": "213",
  "name": "Conversion to View Rate",
  "formula": "CONVERSION / UNIQUE VIEWED * 100",
  "type": "PERCENTAGE",
  "createdAt": "2015-08-05T08:40Z",
  "updatedAt": "2015-08-05T08:40Z"
}

Use this endpoint to get the details of a certain KPI by ID.

Statistics

Get detailed statistics

URL:

GET https://api.crossengage.io/statistics/detailed

Request

Atrributes  
entities
required
array
id

string
Represents the ID of the entity (e.g. Campaign Id) that will be used to return statistics data for. Required when requesting statistics for all entities except for COMPANY_CHANNEL.

245

channel

Required when the type parameter is present with any of the following values: COMPANY_CHANNEL, STORY_CHANNEL, CAMPAIGN_CHANNEL. Represents the channel that statistics should be returned for.

see details about channels here.

type

Represents the type of entity that should be returned according to the ids selected

See details about entity types here.

kpiIds

array
The IDs of the KPIs that will be used to return statistics data for.

Example: 1,12

interval
required

object

Please note that, according to the time interval you request in conjunction with the aggregation, our system will expand your requested interval to fit as many aggregations as possible. For example:

Requesting an interval from 2018-08-24T00:00:00Z to 2018-08-24T23:59:59Z with a MONTH aggregation would return data from 2018-08-01T00:00:00Z to 2018-08-31T23:59:59Z (the entire month of August).</li> When interval is not present, statistics data will be returned for the selected entityIds overall (from their first dispatch and until the present day).

startDate
required
string

ISO 8601 formatted string representing the date and time for which statistics data will be computed from. Required when using the interval object.

2019-09-01T00:00:00Z
endDate
required
string

ISO 8601 formatted string representing the date and time for which statistics data will be computed to. Required when using the interval object.

2019-09-30T23:59:59Z
aggregation
required

The aggregation time units that will be returned from your selected interval. When a time unit is larger than the interval selected, no statistics data will be returned.

Example: WEEK (See more details about the aggregation time units here)

Headers

Content-Type:application/json
X-XNG-ApiVersion:2
X-XNG-AuthToken:Your API Key

Body

{
  "entities": [
    {
      "id": "245",
      "channel": "MAIL",
      "type": "CAMPAIGN_CHANNEL"
    }
  ],
  "kpiIds": [
    "1",
    "12"
  ],
  "interval": {
    "startDate": "2019-09-01T00:00:00Z",
    "endDate": "2019-09-30T23:59:59Z"
  },
  "aggregation": "WEEK"
}

Response

200

Headers

Content-Type:application/json

Body

{
  "interval": {
    "startDate": "2018-08-24T00:00:00Z",
    "endDate": "2018-08-24T23:59:59Z"
  },
  "detailed": [
    {
      "entity": {
        "id": "245",
        "channel": "MAIL",
        "type": "CAMPAIGN_CHANNEL"
      },
      "startDate": "2018-08-24T00:00:00Z",
      "endDate": "2018-08-24T23:59:59Z",
      "kpi": {
        "23": "100.0",
        "25": "80.0",
        "31": "NaN"
      }
    }
  ],
  "overall": [
    {
      "entity": {
        "id": "245",
        "channel": "MAIL",
        "type": "CAMPAIGN_CHANNEL"
      },
      "startDate": "2018-08-24T00:00:00Z",
      "endDate": "2018-08-24T23:59:59Z",
      "kpi": {
        "23": "100.0",
        "25": "80.0",
        "31": "NaN"
      }
    }
  ]
}

 

Use this endpoint to get statistics for certain entity IDs (story, campaign or message ID) on your account according to a variety of aggregation options.

Please note that, according to the time interval you request in conjunction with the aggregation, our system will expand your requested interval to fit as many aggregations as possible. Please see the examples below:

Requesting an interval from 2018-08-24T00:00:00Z to 2018-08-26T23:59:59Z with a MONTH aggregation would return data from 2018-08-01T00:00:00Z to 2018-08-31T23:59:59Z (returning the entire month of August 2018).

Requesting an interval from 2018-08-24T00:00:00Z to 2018-08-31T23:59:59Z with a WEEK aggregation would return data from 2018-08-20T00:00:00Z to 2018-09-02T23:59:59Z (returning calendar Week 34 and 35 of 2018).

Get overall statistics

URL:

POST https://api.crossengage.io/statistics/overall

Request

Atrributes  
entities
required
array
id

string
Represents the ID of the entity (e.g. Campaign Id) that will be used to return statistics data for. Required when requesting statistics for all entities except for COMPANY_CHANNEL.

245

channel

Required when the type parameter is present with any of the following values: COMPANY_CHANNEL, STORY_CHANNEL, CAMPAIGN_CHANNEL. Represents the channel that statistics should be returned for.

see details about channels here.

type

Represents the type of entity that should be returned according to the ids selected

See details about entity types here.

kpiIds

array
The IDs of the KPIs that will be used to return statistics data for.

Example: 1,12

interval
required

object

Please note that, according to the time interval you request in conjunction with the aggregation, our system will expand your requested interval to fit as many aggregations as possible. For example:

Requesting an interval from 2018-08-24T00:00:00Z to 2018-08-24T23:59:59Z with a MONTH aggregation would return data from 2018-08-01T00:00:00Z to 2018-08-31T23:59:59Z (the entire month of August).</li> When interval is not present, statistics data will be returned for the selected entityIds overall (from their first dispatch and until the present day).

startDate
required
string

ISO 8601 formatted string representing the date and time for which statistics data will be computed from. Required when using the interval object.

2019-09-01T00:00:00Z
endDate
required
string

ISO 8601 formatted string representing the date and time for which statistics data will be computed to. Required when using the interval object.

2019-09-30T23:59:59Z

Headers

Content-Type:application/json
X-XNG-ApiVersion:2
X-XNG-AuthToken:Your API Key

Body

{
  "entities": [
    {
      "id": "245",
      "channel": "MAIL",
      "type": "CAMPAIGN_CHANNEL"
    }
  ],
  "kpiIds": [
    "1",
    "12"
  ],
  "interval": {
    "startDate": "2018-08-24T00:00:00Z",
    "endDate": "2018-08-24T23:59:59Z"
  }
}

Response

200

Headers

Content-Type:application/json

Body

Show JSON Schema
[
  {
    "entity": {
      "id": "245",
      "channel": "MAIL",
      "type": "CAMPAIGN_CHANNEL"
    },
    "startDate": "2018-08-24T00:00:00Z",
    "endDate": "2018-08-24T23:59:59Z",
    "kpi": {
      "23": "100.0",
      "25": "80.0",
      "31": "NaN"
    }
  }
]

Use this endpoint to get overall statistics for certain entity IDs (story, campaign or message ID) on your account according to a particular time interval or since the first dispatch of a selected entity until the present.

 

Entity types

COMPANY_CHANNEL string
Representing the statistics for a channel across all entities.
STORY string
Representing the statistics for a story.
STORY_CHANNEL string
Representing the statistics for a channel used within a story.
CAMPAIGN string
Representing the statistics for a campaign.
CAMPAIGN_CHANNEL string
Representing the statistics for a channel used within a campaign.
MESSAGE string
Representing the statistics of a message.
EXPERIMENT string
Representing the statistics of an experiment.
VARIATION string
Representinng the statistics of a variation within an experiment.

Formula

Name Description
SENT

string

Formula of the Sent metric

DELIVERED

string

Formula of the Delivered metric

VIEWED

string

Formula of the Viewed metric

UNIQUE VIEWED

string

Formula of the Unique Viewed metric

CLICKED

string

Formula of the Clicked metric

UNIQUE CLICKED

string

Formula of the Unique Clicked metric

SOFT BOUNCED
string

Formula of the Soft Bounced metric

HARD BOUNCED
string

Formula of the Hard Bounced metric

SOFT BOUNCED + HARD BOUNCED
string

Formula of the Bounced metric

UNSUBSCRIBED
string

Formula of the Unsubscribed metric

MARKED AS SPAM
string

Formula of the Marked as Spam metric

CONVERSION
string

Formula of the Unique Conversion metric

DELIVERED / SENT * 100
string

Formula of the Delivery Rate metric

UNIQUE VIEWED / DELIVERED * 100
string

Formula of the View to Delivery Rate metric

UNIQUE CLICKED / DELIVERED * 100
string

Formula of the Click to Delivery Rate metric

UNIQUE CLICKED / UNIQUE VIEWED * 100
string

Formula of the Click-through-Rate (CTR) metric

(SOFT BOUNCED + HARD BOUNCED) / (SOFT BOUNCED + HARD BOUNCED + DELIVERED) * 100
string

Formula of the Bounce Rate metric

MARKED AS SPAM / DELIVERED * 100
string

Formula of the Spam Rate metric

UNSUBSCRIBED / DELIVERED * 100
string

Formula of the Unsubscribe Rate metric

CONVERSION / DELIVERED * 100
string

Formula of the Conversion to Delivery Rate metric

CONVERSION / UNIQUE VIEWED * 100
string

Formula of the Conversion to View Rate metric

SENT_CONTROL_GROUP
string

Formula of the Not Sent due to Control Group metric

GOAL_COMPLETED_CONTROL_GROUP
string

Formula of the Control Group Conversion metric

GOAL_COMPLETED_CONTROL_GROUP / SENT_CONTROL_GROUP * 100
string

Formula of the Control Group Conversion Rate metric

 

KPI names

Sent

string

Metric representing messages sent to any provider by ActivatePro

Delivered

string

Metric representing messages sent by an integration provider to your users

Viewed

string

Metric representing total message/s views

Unique Viewed

string

Metric representing the number of users that viewed a message/s

Clicked

string

Metric representing the total number of times URLs in a message/s was clicked

Unique Clicked

string

Metric representing the number of users that clicked any message/s link

Soft Bounced

string

Metric representing the number of temporary message/s delivery issues

Hard Bounced

string

Metric representing the number of permanent message/s delivery issues

Bounced

string

Metric representing the total number of message/s delivery issues

Unsubscribed

string

Metric representing the total number of unsubscriptions generated by a given entity

Marked as Spam

string

Metric representing the total number of spam reports generated by a given entity

Conversion

string

Metric representing the total number of conversions generated by a given entity

Delivery Rate

string

Metric representing the delivery rate percentage of a given entity

View to Delivery Rate

string

Metric representing the view to delivery rate percentage of a given entity

Click to Delivery Rate

string

Metric representing the click to delivery rate percentage of a given entity

Click-through-Rate (CTR)

string

Metric representing the click-trough-rate percentage of a given entity

Bounce Rate

string

Metric representing the bounce rate percentage of a given entity

Spam Rate

string

Metric representing the spam rate percentage of a given entity

Unsubscribe Rate

string

Metric representing the unsubscription rate percentage of a given entity

Conversion to Delivery Rate

string

Metric representing the conversion to delivery rate percentage of a given entity

Conversion to View Rate

string

Metric representing the conversion to view rate percentage of a given entity

Conversion to Click Rate

string

Metric representing the conversion to click rate percentage of a given entity

Not Sent due to Control Group

string

Metric representing the number of messages that could not be sent due to users being part of the campaign's Control Group

Control Group Conversion

string

Metric representing the total number of conversions generated by a users which were part of the campaign's Control Group

Control Group Conversion Rate

string

Metric representing the total number of conversions to the total number of users being part of the campaign's Control Group

Channels

BROWSER_NOTIFICATION string
DIRECT_MAIL string
EXIT_INTENT
string
 
INSTANT_MESSAGING string
MAIL

string

Represents the email channel.

OFFLINE
string

Represents the CSV export channel.

PUSH_NOTIFICATION string
SEGMENT_TRANSFER string
SMS string
WEBHOOK string
 

Aggregation

The aggregation time units that will be returned from your selected interval. When a time unit is larger than the interval selected, no statistics data will be returned.

HOUR
string

Representing hours of a calendar day. e.g. 2018-08-24T00:00:00Z to 2018-08-24T01:00:00Z.

DAY
string

Representing a calendar day. e.g. 2018-08-24T00:00:00Z to 2018-08-24T23:59:59Z.

WEEK
string

Representing a calendar week. e.g. 2018-08-20T00:00:00Z to 2018-08-26T23:59:59Z.

MONTH
string

Representing a calendar month. e.g. 2018-08-01T00:00:00Z to 2018-08-31T23:59:59Z.

YEAR
string

Representing a calendar year. e.g. 2018-01-01T00:00:00Z to 2018-12-31T23:59:59Z.