Getting Conversion Rate and Statistics
This page explains how to get your conversion rate and statistics.
Resource
https://api.infobip.com/ct/1/processes/:processKey/conversionrate
Parameters
| Property name | Type | Description |
|---|---|---|
| aggrType | string |
Aggregation type for showing the results. Available values: byCountry, byNetwork or byOsType. If not set, results will be aggregated by time. |
| since | datetime | Interval start. If not set, last 24 hours will be used. |
| until | datetime | Interval end. If not set, current time will be used. |
| tagKeys | string |
Tag key for your process. Must be specified in format: tagKey_1:tagKey_2. |
| mcc | string | Mobile country code. |
| mnc | string | Mobile network code. |
| osType | string | Operating system type. Available values: WINDOWS, LINUX, ANDROID, IOS and WINDOWS_PHONE. |
| intervalGranulation | string | Granulate results into specific intervals. Available values: MINUTE, HOUR, DAY, WEEK and MONTH. |
Request Example
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate/byOsType
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"intervalStart": "2015-02-12T09:58:20.337+0100",
"osType": "ANDROID",
"startCount": 100,
"endCount": 80,
"conversionRate": 0.80
},
{
"intervalStart": "2015-02-12T09:58:20.337+0100",
"osType": "IOS",
"startCount": 100,
"endCount": 90,
"conversionRate": 0.9
}
],
"cumulativeStatistics": {
"startCount": 200,
"endCount": 170,
"conversionRate": 0.85
}
}
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
Response
When successful, the response header HTTP status code will be 200 OK and messages will be returned in the response body.
If you try to get conversion rates and statistics without authorization, you will get a response with a 401 Unauthorized HTTP status code.
ConversionRates
| Parameter | Type | Description |
|---|---|---|
| statistics | ConversionRateStatistics | Conversion rate statistics. |
| cumulativeStatistics | CumulativeStatistics | Cumulative statistics. |
ConversionRateStatistics
| Parameter | Type | Description |
|---|---|---|
| mccmnc | String | Mobile country and network code. |
| intervalStart | Timestamp | Interval start. |
| osType | String | OS type. |
| startCount | long | Start count. |
| endCount | long | End count. |
| conversionRate | double | Conversion rate. |
CumulativeStatistics
| Parameter | Type | Description |
|---|---|---|
| startCount | long | Start count. |
| endCount | long | End count. |
| conversionRate | double | Conversion rate. |
Example: Get conversion rate without filters
This method returns conversion rate statistics for the past 24 hours
JSON Request
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
JSON Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"intervalStart": "2015-02-12T09:58:20.337+0100",
"startCount": 200,
"endCount": 170,
"conversionRate": 0.85
}
],
"cumulativeStatistics": {
"startCount": 200,
"endCount": 170,
"conversionRate": 0.85
}
}
Example: Get conversion rate aggregated by networks
If the previous result doesn’t give enough information and you want to see how many conversions you have in each network, the request below shows how to get it.
Other available aggregation types are byCountry and byOsType.
JSON Request
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate/byNetwork
HTTP/1.1
Host: api.infobip.com
Authorization: Basic xxxxxxxxxxxxxxx
Content-Type: application/json
JSON Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"mccmnc": "22003",
"intervalStart": "2015-02-12T09:58:20.337+0100",
"startCount": 100,
"endCount": 80,
"conversionRate": 0.80
},
{
"mccmnc": "21910",
"intervalStart": "2015-02-12T10:08:20.337+0100",
"startCount": 100,
"endCount": 90,
"conversionRate": 0.9
}
],
"cumulativeStatistics": {
"startCount": 200,
"endCount": 170,
"conversionRate": 0.85
}
}
Example: Get conversion rate by date
You can specify exact dates as filters in the request, and show results in different time intervals. Available intervals are: MINUTE, HOUR, DAY, WEEK and MONTH.
JSON Request
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate?since=2015-04-22T17:42:05.390%2b01:00&until=2015-06-22T17:42:05.390%2b01:00&intervalGranulation=MONTH
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
JSON Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"intervalStart": "2015-04-22T17:42:05.390+0100",
"startCount": 1000,
"endCount": 800,
"conversionRate": 0.8
},
{
"intervalStart": "2015-05-22T17:42:05.390+0100",
"startCount": 1000,
"endCount": 900,
"conversionRate": 0.9
}
],
"cumulativeStatistics": {
"startCount": 2000,
"endCount": 1700,
"conversionRate": 0.85
}
}
Example: Get conversion rate between specific tags in your process
JSON Request
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate?tagKeys=3BE37CCDB6DE3CEB1B9B603D45522558326C:3AB03519969C8008C4A45522558326C
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
JSON Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"mccmnc": "22003",
"intervalStart": "2015-02-12T09:58:20.337+0100",
"osType": "ANDROID",
"startCount": 100,
"endCount": 80,
"conversionRate": 0.8
}
],
"cumulativeStatistics": {
"startCount": 100,
"endCount": 80,
"conversionRate": 0.8
}
}
Example: Get conversion rate with all filters set
GET: /ct/1/process/A37D448C1ACCA02FABA745522558326C/conversionrate/byOsType?tagKeys=A37D448C1ACCA02FABA745522558326C:A37D448C1ACCA02FABA745522558326C&mcc=220&mnc=03&since=2015-02-22T17:42:05.390%2b01:00&until=2015-02-22T19:42:05.390%2b01:00&intervalGranulation=HOUR
HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
JSON Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"statistics": [
{
"mccmnc": "22003",
"intervalStart": "2015-02-22T09:58:20.337+0100",
"osType": "ANDROID",
"startCount": 100,
"endCount": 80,
"conversionRate": 0.80
},
{
"mccmnc": "22003",
"intervalStart": "2015-02-22T10:08:20.337+0100",
"osType": "IOS",
"startCount": 100,
"endCount": 90,
"conversionRate": 0.9
}
],
"cumulativeStatistics": {
"startCount": 200,
"endCount": 170,
"conversionRate": 0.85
}
}