- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- ResponseBlock
- DataTable
- DataTableHeader
- DataTableRow
- DataTableCell
- PropertyChatQuota
- Try it!
Provides a chat interface for interacting with Google Analytics data through the API.
This product uses AI and may display inaccurate info. Your chat activity may be used to improve the product and your use is subject to Google's Terms, AI Use Policy, and Privacy Policy. Learn more about properties.chat AI Privacy.
HTTP request
POST https://analyticsdata.googleapis.com/v1alpha/{property=properties/*}:chat
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
property |
Required. The property to chat about. Format: properties/{property} |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "userQuery": string, "returnPropertyQuota": boolean, "sessionId": string } |
| Fields | |
|---|---|
userQuery |
Required. The user's query. |
returnPropertyQuota |
Optional. If true, the response will include the current state of this Analytics Property's quota. Quota is returned in PropertyChatQuota. |
sessionId |
Optional. Provide this session ID to continue an existing conversation and maintain context. If this field is empty or unset, a new chat session is created. Invalid session IDs will result in an error. |
Response body
Response message for the properties.chat method.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "sessionId": string, "blocks": [ { object ( |
| Fields | |
|---|---|
sessionId |
The unique identifier for this chat session. Provide this ID in subsequent requests to maintain conversational context. |
blocks[] |
The response blocks that make up the chat response. This can include text, tables, and lists. |
propertyQuota |
This Analytics Property's quota state including this request. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/analytics.chatbot.read
ResponseBlock
One block of structured data in chat response.
| JSON representation |
|---|
{
// The following is a list of mutually exclusive fields. At most one of the
// fields will be set in a response:
"text": string,
"table": {
object ( |
| Fields | |
|---|---|
| One block of structured data. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
text |
A block of text. |
table |
A block of table data. |
| End of mutually exclusive fields. | |
DataTable
A table of data.
| JSON representation |
|---|
{ "headers": [ { object ( |
| Fields | |
|---|---|
headers[] |
Describes dimension columns. The number of headers and ordering of headers matches the dimensions present in rows. |
rows[] |
Rows of dimension value combinations and metric values in the report. |
DataTableHeader
Describes a column header in a DataTable.
| JSON representation |
|---|
{ "header": string, "dataType": string } |
| Fields | |
|---|---|
header |
The header name. |
dataType |
The data type. |
DataTableRow
A row in a DataTable.
| JSON representation |
|---|
{
"columns": [
{
object ( |
| Fields | |
|---|---|
columns[] |
The cell values in the row. |
DataTableCell
A cell in a data table.
| JSON representation |
|---|
{ "value": string } |
| Fields | |
|---|---|
value |
The value of the cell. |
PropertyChatQuota
Property quota for chatbot specific fields.
| JSON representation |
|---|
{ "tokensPerDay": { object ( |
| Fields | |
|---|---|
tokensPerDay |
properties.chat tokens consumed per day. |
tokensPerHour |
properties.chat tokens consumed per hour. |