Knowledge Aggregate query
Knowledge aggregate queries show a high-level summary of knowledge base usage metrics during a given interval.
Metrics
Metric | Description | Preview |
nDistinctKnowledgeSessions | Approximate number of distinct sessions. | |
nKnowledgeDocumentCopied | Total number of times the document was copied. | |
nKnowledgeDocumentFeedback | Total number of times feedback was given on the document. | |
nKnowledgeDocumentPresented | Total number of times the knowledge document was presented to a user. | |
nKnowledgeDocumentSurfaced | Total number of times the knowledge document was surfaced during search. | |
nKnowledgeDocumentViewed | Total number of times the document was viewed. | |
nKnowledgeSearch | Total number of times the knowledge base was searched. | |
nKnowledgeSearchAnswered | Total number of times the query was answered. | |
nKnowledgeSearchFeedback | Total number of times the feedback was provided on a document surfaced for a search response. | |
nKnowledgeSearchUnanswered | Total number of times the query was answered. | |
nKnowledgeSessions | Number of knowledge guest sessions. | |
oKnowledgeDocumentQuery | Number of all queries (article views and searches) in a knowledge guest session. | |
oKnowledgeDocumentQuerySelfServed | Number of self-served queries (article views and answered searches without negative feedback) in a knowledge guest session. | |
oKnowledgeSearch | Number of searches in a knowledge guest session. |
Dimensions
Dimension | Type | Description | Preview |
agentAssistantId | UUID | ID of the agent assistant. | |
appDeploymentId | UUID | The deployment ID of the app used for knowledge search. | |
appType | Enum (Assistant, BotFlow, MessengerKnowledgeApp, SmartAdvisor, SupportCenter) | The type of the app used for knowledge search. | |
botFlowId | UUID | ID of the bot flow. | ✔ |
conversationChannelType | Enum (Call, Callback, Email, GenericObject, Messaging, Social, Webchat) | The conversation channel type. | |
conversationId | UUID | The unique identifier of the conversation. | |
documentEngagementType | String | Type of the document engagement related to a knowledge search. | |
externalContactId | UUID | The external contact identifier of the end-user participant. | |
feedbackCategory | Enum (Qualitative, Quantitative) | The feedback category. | |
feedbackId | UUID | The ID of the feedback provided on a search response document. | |
feedbackRating | Enum (Negative, Positive) | The rating of the document feedback. | |
feedbackRatingType | Enum (Binary) | The feedback rating type. | |
feedbackRatingValue | Float | The feedback rating value for a search response document. | |
feedbackReason | Enum (DocumentContent, SearchResults) | The reason for the negative document feedback. | |
feedbackType | Enum (Explicit, Implicit) | The feedback type. | |
hasComment | Boolean | True if there was a textual comment given for the document feedback. | |
hasSearch | Boolean | true if there was at least one search request in the session, false otherwise. | |
knowledgeBaseDocumentId | UUID | The ID of the document. | |
knowledgeBaseDocumentVariationId | UUID | The ID of the variation of the document. | |
knowledgeBaseDocumentVersionId | UUID | The version ID of the document. | |
knowledgeBaseId | UUID | The ID of the knowledge base that was searched. | |
languageCode | String | The language code for the document. | |
mediaType | Enum (Callback, Chat, Cobrowse, Email, Message, Screenshare, Video, Voice) | The media type of the conversation. | |
presentedDocumentsCount | Integer | Total number of documents presented together, in a single event. | |
queryType | Enum (Article, AutoSearch, Category, ManualSearch, Recommendation, Suggestion) | The type of the query that surfaced the document. | |
queueId | UUID | The ID of the queue the agent was working in. | |
searchId | UUID | ID associated with each search event. | |
searchQuery | String | Query associated with each search event. | |
selfServed | Boolean | Indicates whether the knowledge session was self served. | |
sessionId | UUID | The ID of the session. | |
surfacingMethod | Enum (Article, Generative, Highlight, Snippet) | The method how knowledge was surfaced. | |
userId | UUID | ID of the user who performed the search, or for whom the search was performed by the system automatically. |
Metrics and dimensions that are marked as preview may not have been released yet and are subject to change at any time without notice.
The syntax of this query conforms to the general template for aggregate queries.
Example query
This query is asking for the knowledge surfaced metric (nKnowledgeDocumentSurfaced) for all data associated with a specific knowledge base on September 23rd 2020. The results are partitioned into one hour sized buckets and grouped by user ID.
{
"interval": "2020-09-23T00:00:00.000Z/2020-09-24T00:00:00.000Z",
"granularity": "PT1H",
"groupBy": [
"userId"
],
"metrics": [
"nKnowledgeDocumentSurfaced"
],
"filter": {
"type": "and",
"predicates": [
{
"dimension": "knowledgeBaseId",
"value": "00112233-1111-2222-3333-444444444444"
}
]
}
}
Example response
The result returns one group for each interval and user ID with matching data. The original query asked for a full day broken into one hour partitions. In the response, there are only two intervals with matching data. Within each, we see the aggregated metric count.
{
"results": [{
"group": {
"userId": "87654321-1111-2222-3333-444444444444"
},
"data": [{
"interval": "2020-09-23T10:00:00.000Z/2020-09-23T11:00:00.000Z",
"metrics": [{
"metric": "nKnowledgeDocumentSurfaced",
"stats": {
"count": 4
}
}]
}]
}, {
"group": {
"userId": "00112233-1111-2222-3333-444444444444"
},
"data": [{
"interval": "2020-09-23T12:00:00.000Z/2020-09-23T13:00:00.000Z",
"metrics": [{
"metric": "nKnowledgeDocumentSurfaced",
"stats": {
"count": 14
}
}]
}]
}]
}