Stay organized with collectionsSave and categorize content based on your preferences.
Analysis rules are designed to provide more flexible and user-friendly automatic analysis of your contact center conversations. By defining rules, you can specify exactly which conversations to analyze and which types of analysis to perform. Conversational Insights adopts your specifications automatically when ingesting conversations, so that you can control the budget and focus on important conversations to analyze.
Analysis rule capabilities
Analysis rules provide the following customization capabilities all in one place:
Usefiltersto choose which conversations to analyze.
Specify the percentage of your conversation dataset for Insights to analyze.
Designate different types of analysis for each portion of your dataset.
The existinganalysis configuration settingslet you specify the percentage of conversations to analyze and designate the type of analysis to use on your full conversation dataset. However, with analysis rules, you can also filter your conversations, then specify both the percentage and analysis type to use for the filtered dataset. Analysis rules replace the analysis configuration settings.
On demand analysis
Insights uses analysis rules to determine which analyses to perform on the conversation, unless the user explicitly specifies the analysis types to use.
Note the following details for using analysis rules with an API.
CreateAnalysisAPIalways analyzes the conversation when requested and disregards the percentage specified in the matching analysis rules.
BulkAnalyzeConversationsAPIuses the percentage specified in theBulkAnalyzeConversationsrequest over the one in the analysis rules.
Automatic analysis
After you configure active analysis rules, the following changes occur:
Insights matches conversations against all active analysis rules to decide what analysis to perform for the conversation.
If a conversation does not fit any rules, then Insights does not automatically analyze the conversation.
Insights supports automatic analysis for conversations uploaded with the console or one of the following API methods:
Insights does not support automatic analysis for conversations uploaded with the following methods:
Dialogflow runtime ingestionDetectIntentAPI: This API does not have a notion of conversation completion, so Insights cannot determine when to analyze a conversation.
When you create an analysis rule, you can use the following:
Filters:Conversation filtersallow you to narrow down your conversation dataset and analyze a smaller number of related conversations. Analysis rules offer the ability to filter your conversation dataset before running any analyses. Crucially, the filtering criteria cannot depend on the analysis result. For example, a single conversation with a specific custom highlight cannot be a conversation filter.
Conversation percentage: With an analysis rule, you can also configure the percentage of conversations for Insights to automatically analyze. If an uploaded conversation passes a rule's filter, then Insights decides whether or not that conversation should be analyzed based on the percentage specified in the rule.
Follow these steps to create an analysis rule.
Console
Navigate to the Insights console, and sign in with your Google Account.
ForAnalysis percentage, enter the percentage of your conversation dataset that you want Insights to analyze.
Select the type of analysis you want to run forAnnotator selectorsand choose one of the required options. For additional details, see the following section.
ClickSave.
API
Using theAnalysisRulesAPI, you can create an analysis rule with theCreateAnalysisRulecommand. You can define each aspect of a rule with parameter values. For example, you must give each rule a name using theDisplay_nameparameter with a non-empty string value of less than 64 characters. You can also decide whether or not to use a rule for conversation analysis by setting theActiveparameter with a boolean value.
The following code illustrates how to create a rule withCreateAnalysisRule:
Use theConversation_filterparameter. The value must be an alphanumeric string. If the value is empty, the rule applies to all your conversations.
Conversation percentage
Use theAnalysis_percentageparameter. The value must be a number between 0 and 1, where 1 means 100%. You can only use this parameter in a rule to configure an automated analysis. In other words, this percentage does not apply to theCreateAnalysisorBulkAnalysiscommands.
Analysis types
Use theAnnotator_selectorparameter. The value must be anAnnotatorSelectorobject. This configuration specifies which annotators to run for a specific set of conversations. A valid active analysis rule must contain at least one enabled annotator.
You can also create multiple analysis rules in Insights. If a conversation matches multiple rules, Insights applies a combination of all the requirements specified in all the matching rules. However, if a conversation matches conflicting rules, Insights doesn't analyze that conversation.
Analysis types
Conversational Insights offers a variety of analysis types to help you better understand your conversation data. With an analysis rule, you can apply different analysis types to each portion of your filtered or unfiltered conversation dataset.
Insights offers the following analysis types:
Custom and smart highlights
Entity extraction
Intent extraction
Interruptions
Sentiment
Silence
Quality AI
Summarization
Topic modeling
Additional operations
You can use the following additional API commands with analysis rules:
Find the rule used for a particular conversation withGetAnalysisRule.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eAnalysis rules allow customization of Conversational Insights analyses, enabling filtering of conversations, specifying analysis percentages, and designating analysis types for different data subsets.\u003c/p\u003e\n"],["\u003cp\u003eAnalysis rules replace the previous analysis configuration settings, and updates to those prior settings are now ignored by Insights.\u003c/p\u003e\n"],["\u003cp\u003eAutomatic analysis using the active analysis rules involves matching uploaded conversations to rules, and if no rule matches, the conversation is not automatically analyzed.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAnalysisRules\u003c/code\u003e API lets you create, find, list, edit, and remove rules, with parameters to define the rule's name, filter, active state, analysis percentage, and annotator types.\u003c/p\u003e\n"],["\u003cp\u003eInsights offers different analysis types like custom and smart highlights, entity extraction, sentiment, and more, all configurable with the \u003ccode\u003eAnnotator_selector\u003c/code\u003e parameter.\u003c/p\u003e\n"]]],[],null,["# Configure analysis rules\n\nAnalysis rules are designed to provide more flexible and user-friendly automatic analysis of your contact center conversations. By defining rules, you can specify exactly which conversations to analyze and which types of analysis to perform. Conversational Insights adopts your specifications automatically when ingesting conversations, so that you can control the budget and focus on important conversations to analyze.\n\nAnalysis rule capabilities\n--------------------------\n\nAnalysis rules provide the following customization capabilities all in one place:\n\n- Use [filters](/contact-center/insights/docs/filtering) to choose which conversations to analyze.\n- Specify the percentage of your conversation dataset for Insights to analyze.\n- Designate different types of analysis for each portion of your dataset.\n\nThe existing [analysis configuration settings](/contact-center/insights/docs/reference/rest/v1/Settings#analysisconfig) let you specify the percentage of conversations to analyze and designate the type of analysis to use on your full conversation dataset. However, with analysis rules, you can also filter your conversations, then specify both the percentage and analysis type to use for the filtered dataset. Analysis rules replace the analysis configuration settings.\n| **Note:** Insights denies any updates to the old [analysis configuration settings](/contact-center/insights/docs/reference/rest/v1/Settings#analysisconfig), and that configuration is disregarded in favor of the analysis rules.\n\nOn demand analysis\n------------------\n\nInsights uses analysis rules to determine which analyses to perform on the conversation, unless the user explicitly specifies the analysis types to use.\n\nNote the following details for using analysis rules with an API.\n\n- [`CreateAnalysis` API](/contact-center/insights/docs/create-analyze-conversation-api) always analyzes the conversation when requested and disregards the percentage specified in the matching analysis rules.\n- [`BulkAnalyzeConversations` API](/contact-center/insights/docs/bulk-analyze-api) uses the percentage specified in the `BulkAnalyzeConversations` request over the one in the analysis rules.\n\nAutomatic analysis\n------------------\n\nAfter you configure active analysis rules, the following changes occur:\n\n1. Insights matches conversations against all active analysis rules to decide what analysis to perform for the conversation.\n2. If a conversation does not fit any rules, then Insights does not automatically analyze the conversation.\n\nInsights supports automatic analysis for conversations uploaded with the console or one of the following API methods:\n\n- [`UploadConversations` API](/contact-center/insights/docs/reference/rest/v1/projects.locations.conversations/upload)\n- [Dialogflow runtime Ingestion](/contact-center/insights/docs/dialogflow-runtime-integration) `AnalyzeContent` API\n- [`CreateAnalysis` API](/contact-center/insights/docs/create-analyze-conversation-api)\n\nInsights does not support automatic analysis for conversations uploaded with the following methods:\n\n- [Dialogflow runtime ingestion](/contact-center/insights/docs/dialogflow-runtime-integration) `DetectIntent` API: This API does not have a notion of conversation completion, so Insights cannot determine when to analyze a conversation.\n- [`IngestConversations` API](/contact-center/insights/docs/reference/rest/v1/projects.locations.conversations/ingest): Also referred to as bulk upload.\n\nTo analyze these conversations, you can use the [`BulkAnalyzeConversations` API](/contact-center/insights/docs/bulk-analyze-api).\n\nCreate a rule\n-------------\n\nWhen you create an analysis rule, you can use the following:\n\n- **Filters** : [Conversation filters](/contact-center/insights/docs/filtering) allow you to narrow down your conversation dataset and analyze a smaller number of related conversations. Analysis rules offer the ability to filter your conversation dataset before running any analyses. Crucially, the filtering criteria cannot depend on the analysis result. For example, a single conversation with a specific custom highlight cannot be a conversation filter.\n- **Conversation percentage**: With an analysis rule, you can also configure the percentage of conversations for Insights to automatically analyze. If an uploaded conversation passes a rule's filter, then Insights decides whether or not that conversation should be analyzed based on the percentage specified in the rule.\n\nFollow these steps to create an analysis rule. \n\n### Console\n\n1. Navigate to the Insights console, and sign in with your Google Account.\n\n [Insights console](https://ccai.cloud.google.com/insights)\n2. Enter your project ID.\n\n3. Click settings \\\u003e **Analysis rules** \\\u003e **+ Create**.\n\n4. Give the rule a name in **Rule Name**.\n\n - The name can contain a maximum of 100 characters.\n5. Keep the **Status** set to active.\n\n6. Select a conversation type from the **Filters** menu.\n\n7. For **Analysis percentage**, enter the percentage of your conversation dataset that you want Insights to analyze.\n\n8. Select the type of analysis you want to run for **Annotator selectors** and choose one of the required options. For additional details, see the following section.\n\n9. Click **Save**.\n\n### API\n\nUsing the [`AnalysisRules` API](/contact-center/insights/docs/reference/rest/v1/projects.locations.analysisRules), you can create an analysis rule with the `CreateAnalysisRule` command. You can define each aspect of a rule with parameter values. For example, you must give each rule a name using the `Display_name` parameter with a non-empty string value of less than 64 characters. You can also decide whether or not to use a rule for conversation analysis by setting the `Active` parameter with a boolean value.\n\nThe following code illustrates how to create a rule with `CreateAnalysisRule`: \n\n```\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d \"{ display_name: 'runtime' , conversation_filter: 'data_source.gcs_source: \"*\"', annotator_selector:{run_silence_annotator : true, run_sentiment_annotator: true}, analysis_percentage:0.4, active:true}\" \\\n \"https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/analysisRules\"\n```\n\nThe following is an example JSON representation of an analysis rule: \n\n```sh\n{\n\"display_name\": string , \n\"conversation_filter\": string, \n\"annotator_selector\": object (AnnotatorSelector), \n\"analysis_percentage\": number, \n\"active\": boolean\n}\n```\n\n### Filter conversations\n\nUse the `Conversation_filter` parameter. The value must be an alphanumeric string. If the value is empty, the rule applies to all your conversations.\n\n### Conversation percentage\n\nUse the `Analysis_percentage` parameter. The value must be a number between 0 and 1, where 1 means 100%. You can only use this parameter in a rule to configure an automated analysis. In other words, this percentage does not apply to the `CreateAnalysis` or `BulkAnalysis` commands.\n\n### Analysis types\n\nUse the `Annotator_selector` parameter. The value must be an [`AnnotatorSelector`](/contact-center/insights/docs/reference/rest/v1/projects.locations.conversations.analyses#Analysis.AnnotatorSelector) object. This configuration specifies which annotators to run for a specific set of conversations. A valid active analysis rule must contain at least one enabled annotator.\n\nYou can also create multiple analysis rules in Insights. If a conversation matches multiple rules, Insights applies a combination of all the requirements specified in all the matching rules. However, if a conversation matches conflicting rules, Insights doesn't analyze that conversation.\n\n### Analysis types\n\nConversational Insights offers a variety of analysis types to help you better understand your conversation data. With an analysis rule, you can apply different analysis types to each portion of your filtered or unfiltered conversation dataset.\n\nInsights offers the following analysis types:\n\n- Custom and smart highlights\n- Entity extraction\n- Intent extraction\n- Interruptions\n- Sentiment\n- Silence\n- Quality AI\n- Summarization\n- Topic modeling\n\nAdditional operations\n---------------------\n\nYou can use the following additional API commands with analysis rules:\n\n- Find the rule used for a particular conversation with `GetAnalysisRule`.\n\n ```\n curl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/analysisRules/ANALYSIS_RULE_ID\"\n ```\n- List all of your rules with `ListAnalysisRules`.\n\n ```\n curl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/analysisRules\"\n ```\n- Edit a rule with `UpdateAnalysisRule`.\n\n ```\n curl -X PATCH \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d '{annotator_selector: {run_silence_annotator: true}}' \\\n \"https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/analysisRules/ANALYSIS_RULE_ID?updateMask=annotator_selector\"\n ```\n- Remove a rule with `DeleteAnalysisRule`.\n\n ```\n curl -X DELETE \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/analysisRules/ANALYSIS_RULE_ID\"\n ```"]]