Events¶
Add a list of events¶
POST /project/events/add
With this method, you can add a list of events.
curl 'https://cloud.roistat.com/api/v1/project/events/add?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
[
{
"display_name": "test1",
"type": "js",
"parameter": "js-12"
},
{
"display_name": "test2",
"type": "url",
"parameter": "http://test.com"
}
]
{
"events": [
{
"id": "13",
"display_name": "test1",
"type": "js",
"parameter": "js-12"
},
{
"id": "14",
"display_name": "test2",
"type": "url",
"parameter": "http://test.com"
}
],
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
display_name | string | event name | no |
type | string | js or url - defines the condition for triggering an event | no |
parameter | string | event ID or link | no |
Parameter | Type | Description |
---|---|---|
events | array[object] | |
> id | string | |
> display_name | string | |
> type | string | |
> parameter | string | |
status | string |
Send events¶
POST /project/events/send
With this method, you can send events.
curl 'https://cloud.roistat.com/api/v1/project/events/send?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
{
"name": "Click on a form",
"visit": "100001",
"data": {
"region": "London",
"landing": 1
}
}
{
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
name | string | Event name (previously set in Roistat) | yes |
visit | string | Visit number from the roistat_visit cookie | no |
data | object | Additional parameters of the event (you'll see them in the Events history in the "Add. fields" column) | no |
Parameter | Type | Description |
---|---|---|
status | string |
Send multiple events¶
POST /project/events/bulk/send
With this method, you can send multiple events.
curl 'https://cloud.roistat.com/api/v1/project/events/bulk/send?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
[
{
"name": "Click on a form",
"visit": "100001",
"data": {
"region": "London",
"landing": 1
}
},
{
"name": "Click on a form",
"visit": "100002",
"data": {
"region": "London",
"landing": 1
}
}
]
{
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
name | string | Event name (previously set in Roistat) | no |
visit | string | Visit number from the roistat_visit cookie | no |
data | object | Additional parameters of the event (you'll see them in the Events history in the Add. fields column) | no |
Parameter | Type | Description |
---|---|---|
status | string |