Marketing Channels¶
Get the full list of advertising channels that are used in the project¶
POST /project/analytics/source/list
This method allows to get a complete list of marketing channels integrated with a project.
curl 'https://cloud.roistat.com/api/v1/project/analytics/source/list?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}'
{
"data": [
{
"name": "Yandex.Direct",
"system_name": "direct2",
"icon": "https://favicon.yandex.net/favicon/www.direct.yandex.ru"
},
{
"name": "Yandex.Market",
"system_name": "yamarket4",
"icon": "https://favicon.yandex.net/favicon/market.yandex.ru"
}
],
"total": 2,
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
No parameters.
Parameter | Type | Description |
---|---|---|
data | array[object] | |
> name | string | A human-readable name of a marketing channel |
> system_name | string | Channel's system name |
> icon | string | URL where a channel icon is stored |
total | integer | |
status | string |
Download data on all expenses ever entered in Analytics¶
POST /project/analytics/source/cost/list
Using this method, you can download data on all expenses ever entered in Analytics.
curl 'https://cloud.roistat.com/api/v1/project/analytics/source/cost/list?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}'
[
{
"id": "123",
"source": "google_seo_test",
"name": "Google -> SEO -> Test",
"from_date": "2016-07-01",
"to_date": "2016-07-31",
"timezone": "Europe/Paris",
"marketing_cost": 500
}
]
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
No parameters.
Parameter | Type | Description |
---|---|---|
id | string | ID of expense in Roistat |
source | string | System name of marketing channel |
name | string | Human-readable name of marketing channel |
from_date | string | Start date of the period of the expense |
to_date | string | End date of the period of the expense |
timezone | string | Timezone |
marketing_cost | integer | Amount spent on marketing channel for the specified period |
Add expenses for the advertising channel for a period¶
POST /project/analytics/source/cost/add
With this method, you can add expenses for the advertising channel for a period.
curl 'https://cloud.roistat.com/api/v1/project/analytics/source/cost/add?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
{
"source": "google_seo_test",
"from_date": "2016-07-01",
"to_date": "2016-07-31",
"timezone": "Europe/Moscow",
"marketing_cost": 500
}
{
"data": {
"id": "8",
"date_from": "2021-05-04T21:00:00.000Z",
"date_to": "2021-05-05T20:59:59.999Z",
"timezone": "Europe/Moscow",
"marker": "",
"title": "Direct visits",
"comment": null,
"cost": 500000,
"create_date": "2021-05-20 10:31:05",
"update_date": "2021-05-20 10:31:05"
},
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
source | string | System name of the marketing channel | yes |
from_date | string | Start date of the period in the format 2016-07-01 | yes |
to_date | string | End date of the period in the format 2016-07-31 | yes |
timezone | string | Timezone | no |
marketing_cost | integer | Amount | yes |
Parameter | Type | Description |
---|---|---|
data | object | |
> id | string | Expense ID |
> date_from | string | Start date of the period |
> date_to | string | End date of the period |
> timezone | string | Timezone |
> marker | string | System name of the channel |
> title | string | Channel title |
> comment | null or string | Comment |
> cost | integer | Amount spent on the channel |
> create_date | string | Date of adding the expense |
> update_date | string | Date of updating the expense |
status | string |
Edit previously entered expense for an advertising channel¶
POST /project/analytics/source/cost/update
This method is used to edit previously entered expense for an advertising channel.
curl 'https://cloud.roistat.com/api/v1/project/analytics/source/cost/update?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
{
"id": 123,
"marketing_cost": 500
}
{
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
id | integer | Expense ID | no |
marketing_cost | integer | New amount | no |
Parameter | Type | Description |
---|---|---|
status | string |
Remove a previously entered expense from an advertising channel¶
POST /project/analytics/source/cost/delete
This method is used to remove a previously entered expense from an advertising channel.
curl 'https://cloud.roistat.com/api/v1/project/analytics/source/cost/delete?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
{
"id": 12
}
{
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
id | integer | ID of expense for marketing channel | no |
Parameter | Type | Description |
---|---|---|
status | string |