2.0.13 • Published 4 years ago
event-api-client v2.0.13
node-event library to push to event-api
To install add this repository url to the packages.json file.
Data event
| Name | Type | Description |
|---|---|---|
| category | string | Event category |
| cid | string | Unique client id, must be UUIDv4 |
| action | string | Event action e.g. 'click' |
| data | mixed | Custom data, any type. Accepts JSON object. |
| label | array | Event label e.g. Eastern campaign (if no label, use empty array []) |
| uid | string | UserID (optional) |
Google Analytics event
| Name | Type | Description |
|---|---|---|
| category | string | Event category |
| cid | string | Unique client id, must be UUIDv4 |
| action | string | Event action e.g. 'click' |
| label | string | Event label e.g. Eastern campaign (if no label, use empty string "") |
| value | integer | Event value (if no value, use empty string "") |
| uid | string | UserID (optional) |
Google Analytics Pageview
| Name | Type | Description |
|---|---|---|
| title | string | Pageview category, page title |
| cid | string | Unique client id, must be UUIDv4 |
| hostname | string | Hostname from which content was hosted |
| page | string | Page path name, must start with '/' |
| uid | string | UserID (optional) |
Example
event.data("category", "UUIDv4", "action", {"data":"random"}, ["label1", "label2"], "UserID");
event.ga("category", "UUIDv4", "action", "label", "value", "UserID");
event.pageview("title", "UUIDv4", "hostname.com", "/page", "UserID");Config parameters in Client-API config
| Name | Type | Description |
|---|---|---|
| api.endpoint | string | Event-API endpoint, ending '/' |
| interval | number | Interval between retries |
| pool | number | Maximum amount of requests in queue |
| requests | number | Maximum amount of requests worked paraller |
| retries | number | How many times to retry sending queue |
Example
"nodeEvent": {
"api": {
"endpoint": "https://localhost:8000/"
},
"interval": 3,
"pool": 1000,
"requests": 1024,
"retries": 3
}