Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LC-1237 added stats/visitors report docs #1452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions payloads/data-reporting/v3.6/reports-api/index.js
Expand Up @@ -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";
@@ -0,0 +1,7 @@
{
"name": "visitors-report",
"summary": {
"unique_visitors": 282,
"page_views": 366
}
}
62 changes: 62 additions & 0 deletions src/pages/data-reporting/reports-api/v3.6/index.mdx
Expand Up @@ -934,6 +934,68 @@ https://api.livechatinc.com/v3.6/reports/tags/chat_usage \
</Code>
</Section>

## Stats

<Section>
<Text>

### 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. |

</Text>
<Code>

<CodeSample path={'REQUEST'}>

<Sample>

```shell
curl -X POST \
https://api.livechatinc.com/v3.6/reports/stats/visitors \
-H 'Authorization: Bearer <your_access_token>' \
-H 'Content-Type: application/json' \
-d '{
"filters": {
"from": "2024-01-01T00:00:00+00:00",
"to": "2024-01-07T23:59:59+00:00"
}
}'
```

</Sample>
</CodeSample>

<CodeResponse type="reports" version="v3.6" json="visitors"/>

</Code>
</Section>

# 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)