diff --git a/payloads/data-reporting/v3.6/reports-api/index.js b/payloads/data-reporting/v3.6/reports-api/index.js index d04695b42..f8e950dc1 100644 --- a/payloads/data-reporting/v3.6/reports-api/index.js +++ b/payloads/data-reporting/v3.6/reports-api/index.js @@ -13,3 +13,4 @@ export { default as forms } from "./responses/chats/forms.json"; export { default as responseTime } from "./responses/chats/responseTime.json"; export { default as firstResponseTime } from "./responses/chats/firstResponseTime.json"; export { default as chatUsage } from "./responses/tags/chatUsage.json"; +export { default as visitors } from "./responses/stats/visitors.json"; diff --git a/payloads/data-reporting/v3.6/reports-api/responses/stats/visitors.json b/payloads/data-reporting/v3.6/reports-api/responses/stats/visitors.json new file mode 100644 index 000000000..e2727bb29 --- /dev/null +++ b/payloads/data-reporting/v3.6/reports-api/responses/stats/visitors.json @@ -0,0 +1,7 @@ +{ + "name": "visitors-report", + "summary": { + "unique_visitors": 282, + "page_views": 366 + } +} diff --git a/src/pages/data-reporting/reports-api/v3.6/index.mdx b/src/pages/data-reporting/reports-api/v3.6/index.mdx index be867c231..c2535a8af 100644 --- a/src/pages/data-reporting/reports-api/v3.6/index.mdx +++ b/src/pages/data-reporting/reports-api/v3.6/index.mdx @@ -934,6 +934,68 @@ https://api.livechatinc.com/v3.6/reports/tags/chat_usage \ +## Stats + +
+ + +### Visitors + +Shows the total number of unique visitors and their page views during a specified period of time. + +#### Specifics + +| | | +| ------------------- | --------------------------------------------------------- | +| **Method URL** | `https://api.livechatinc.com/v3.6/reports/stats/visitors` | +| **HTTP method** | POST, GET | +| **Required scopes** | `reports_read` | + +#### Request + +| Parameter | Required | Data type | Notes | +| ----------------------- | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `timezone` | No | `string` | IANA [Time Zone](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (e.g. America/Phoenix). By default, the timezone is taken from the request. If it isn't provided, then it's taken from the agent's timezone. When it's impossible to load the agent's timezone, `filters.from` is parsed to get it. | +| `filters` | No | `object` | If none provided, your report will span the last seven days. | +| `filters.from` | No | `string` | Filters out chats that took place within the time range defined as <`from`,`to`>. Date & time format compatible with RFC3339 with optional resolution of microseconds, `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`. | +| `filters.to` | No | `string` | Filters out chats that took place within the time range defined as <`from`,`to`>. Date & time format compatible with RFC3339 with optional resolution of microseconds, `YYYY-MM-DDTHH:MM:SS.ssssss+HH:MM`. | + +#### Response + +| Field | Notes | +| ------------------------- | ------------------------------------------------------------------- | +| `summary` | Summary for all agents | +| `summary.unique_visitors` | A total number of unique visitors in the specified period of time. | +| `summary.page_views` | A total number of their page views in the specified period of time. | + + + + + + + + +```shell +curl -X POST \ + https://api.livechatinc.com/v3.6/reports/stats/visitors \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "filters": { + "from": "2024-01-01T00:00:00+00:00", + "to": "2024-01-07T23:59:59+00:00" + } +}' +``` + + + + + + + +
+ # Contact us If you found a bug or a typo, you can create an issue on [GitHub](https://github.com/livechat/livechat-public-docs/). In case of any questions or feedback, don't hesitate to contact us at [developers@text.com](mailto:developers@text.com)