AWS Contact Center

Managing Agent Quality using Amazon Connect Contact Lens and Evaluation Capabilities

Introduction

Organizations often struggle to gain a complete view of their agents’ performance. This is due to the large volume of interactions and the various channels through which they communicate with customers. Additionally, filtering relevant data points for performance analysis can be a difficult task. Fortunately, Contact Lens for Amazon Connect offers agent performance evaluation capabilities using evaluation forms. Contact center managers create these forms based on specific criteria such as adherence to talk scripts or compliance with sensitive data collection practices. Contact Lens’ machine learning-powered conversational analytics can score these evaluation forms to provide a comprehensive view of agents’ performance.

Furthermore, Contact Lens allows organizations to stream evaluation form output data and Contact Records (previously known as Contact Trace Records) to their data lake – enabling advanced analytics. With this powerful tool, managers can gain invaluable insights into agents’ performance trends and make data-driven decisions to improve customer service. Our customers like FrontDoor and Ameriflex benefit from the evaluation capabilities by improving their Quality Assurance efficiency. Partners like Cognizant help enable their customers capture more insight on agent performance, identify opportunities for training, and enhance contact center operation.

In this blog, you will learn how to stream Contact Record from Amazon Connect, process evaluation form data, correlate the data, and visualize the results using Amazon QuickSight. By using these powerful features, organizations can optimize their customer service operations and elevate their customer experience.

Overview

Architecture diagram image

Fig 1–High-level architecture diagram

The architecture described above enables real-time processing of data from Amazon Connect Contact Center using Amazon Kinesis Streams and Kinesis Data Firehose, and allows for querying and visualization of the data using AWS Glue Catalog, Amazon Athena, and Amazon QuickSight.

Amazon Kinesis Streams is used to send Amazon Connect Contact records (CTR) to an Amazon Simple Storage Service (S3) bucket. The Contact Records captures the events associated with a contact from your contact center. Amazon Connect ensures that CTRs are delivered at least once, and may deliver more CTRs for the same call if new information arrives after initial delivery.

When the evaluation performance feature of Amazon Connect is activated, the evaluation form output file is delivered directly to the same S3 bucket once I complete the evaluation. The delivery of this output file triggers an Amazon EventBridge event, which is sent to Amazon Kinesis Data Firehose. Kinesis Data Firehose collects these events for a defined interval and uses AWS Lambda to retrieve the content of each file from the S3 bucket. The Kinesis Data Firehose compresses the retrieved records from these files into a parquet file using the schema defined in the AWS Glue Catalog, and stores the compressed parquet file in the S3 bucket.

The AWS Glue Catalog has the table definitions for CTRs and evaluation form output files. These files can be related using the Contact Id field and queries can be run using Amazon Athena. Amazon QuickSight is used for visualization purposes.

Prerequisites

To follow along with the solution presented in this blog post, you should be familiar with the following AWS services and features:

Assign the following analytics and optimization security profile permissions to allow your Amazon Connect users to create, define, and access evaluation forms:

  • Evaluation forms – perform evaluations
  • Evaluation forms – manage form definitions

In addition, you need the following prerequisites to deploy the AWS Cloud Development Kit (CDK) data pipeline project:

  • AWS Account
  • AWS IAM user with administrator permissions
  • Amazon Connect instance with Contact Lens and the evaluation feature enabled
  • Node (v16) and NPM (v8.5) installed and configured on your computer
  • AWS Command-Line Interface (CLI) (v2) installed and configured on your computer
  • AWS CDK (v2) installed and configured on your computer
  • The deployment of this blog scenario will require the creation of six S3 buckets. The deployment of the full starter project will require twelve S3 buckets.

Walkthrough

This walkthrough has two parts. First, you deploy the CDK data pipeline project. Second, you deploy a CFT to create the QuickSight dashboard.

Deploy data pipeline

The data analytics sample project is available on GitHub https://github.com/aws-samples/amazon-connect-data-analytics-sample. The instructions below show how to deploy the solution using AWS CDK CLI. If you are using a Windows device, use the Git Bash terminal and use alternative commands where highlighted.

  1. Clone the solution to your computer: git clone https://github.com/aws-samples/amazon-connect-data-analytics-sample
  2. Check AWS CLI settings:
    1. AWS CDK will use AWS CLI local credentials and Region.
    2. Ensure you are working in the intended region.
  3. Install NPM packages
    1. Open your Terminal (Git Bash on Windows) and navigate to amazon-connect-data-analytics-sample/cdk-stacks.
    2. Run npm run install:all.
  4. Configure CDK stacks
    • In your Terminal (Git Bash on Windows), navigate to amazon-connect-data-analytics-sample/cdk-stacks.
    • For the purpose of this guide, start the configuration script in interactive mode npm run configure.
    • To enable the necessary features for this blog, ctr-stack-enabled, ctr-partitioning-schedule-enabled, ef-stack-enabled, ef-partitioning-schedule-enabled and ef-reporting-stack-enabled must be set to true.
    • When prompted, provide the following parameters:
    • aws-glue-database-name: AWS Glue Database to hold tables for Amazon Connect Data Analytics (default AmazonConnectDataAnalyticsDB)
    • ctr-stack-enabled: Set to true to deploy Contact Trace Records (CTR) Stack
    • ctr-partitioning-schedule-enabled: Set to true if you want to schedule CTR Partitioning Job in EventBridge
    • ae-stack-enabled: Set to true to deploy Agent Events (AE) Stack
    • ae-partitioning-schedule-enabled: Set to true if you want to schedule AE Partitioning Job in EventBridge
    • cfl-stack-enabled: Set to true to deploy Contact Flow Logs (CFL) Stack
    • cfl-partitioning-schedule-enabled: Set to true if you want to schedule CFL Partitioning Job in EventBridge
    • connect-contact-flow-logs-cloudwatch-log-group: Set Amazon CloudWatch log group where Amazon Connect Contact Flow Logs are stored (i.e. /aws/connect/<your-instance-alias>)
    • cl-stack-enabled: Set to true to deploy Contact Lens (CL) Stack
    • connect-contact-lens-s3-bucket-name: The S3 bucket where Amazon Connect stores Contact Lens output files (and Amazon Connect Call Recordings)
    • cl-partitioning-schedule-enabled: Set to true if you want to schedule CL Partitioning Job in EventBridge
    • ef-stack-enabled: Set to true, to deploy Evaluation Forms (EF) Stack.
    • connect-evaluation-forms-s3-bucket-path: The S3 bucket name and prefix where Amazon Connect stores Evaluation Forms output files (i.e. <your-bucket-name>/connect/<your-instance-alias>/ContactEvaluations).
    • ef-partitioning-schedule-enabled: Set to true, if you want to schedule EF partitioning job in EventBridge.
    • ef-reporting-stack-enabled: Set to true, if you want visualization capabilities. This will deploy the Athena views that the QuickSight dashboard will use as a data source.
  5. Deploy CDK stacks:
    1. In your terminal (Git Bash on Windows), navigate to amazon-connect-data-analytics-sample/cdk-stacks.
    2. In case you started with a new environment, bootstrap CDK with the command,cdk bootstrap
    3. Run the script, npm run cdk:deploy. On Windows devices, use npm run cdk:deploy:gitbash.
  6. Console configuration:
    1. Sign in to the AWS Management Console in your preferred Region.
    2. Navigate to the Amazon Connect instance S3 bucket (the bucket where Amazon Connect stores Contact Lens output files and Call Recordings), select Properties. In the section Amazon EventBridge, choose the Edit button and toggle On notifications.
    3. In the Connect instance, go to Data streaming, and Enable data streaming. For Contact Trace Records, choose the CTRKinesisStream created by the CDK stack.
    4. Navigate to the Amazon Athena Query editor, go to Settings, and set the Query result location to the bucket amazonconnectdataanalyticssample-ar-<account-id>-<region>.
    5. Note: Do NOT select “amazonconnectdataanalyticssample-ar-al-<account-id>-<region>,” as the “al” in the bucket name denotes “access logs.”
    6. Navigate back to the Editor in the Athena console. In the section called Views, click on the three dots next to each view name. Choose Show/edit query, then choose Run. In this way, run the views in the following order:
      1. connect_ctr_denormalized
      2. connect_ef_evaluationquestionanswers_view
      3. connect_ef_evaluationsectionsscores_view
      4. connect_ef_evaluationsall_view
      5. final_connect_ef_evaluationsall_view
      6. final_connect_evaluation_ctr_view

Deploy evaluation forms dashboard

  1. Sign in to the AWS Management Console in your preferred Region.
  2. Create a QuickSight account (skip this step if you already have a QuickSight account):
    1. Navigate to the QuickSight service from the console.
    2. Choose Sign up for QuickSight.
    3. Select the edition and choose Continue.
    4. Select the same Region that your data pipeline is deployed in. Enter your account name and notification email address.
  3. Allow access and autodiscovery for Amazon Athena and the Amazon S3 output buckets (specifically all the buckets deployed as a part of amazonconnectdataanalyticssample) with Write permission for Athena Workgroup enabled, then choose Finish.
    • Note: If you already have an Amazon QuickSight account, then follow the steps below:
      1. Navigate to QuickSight, click on the icon in the top right corner and select Manage QuickSight.
      2. Click on Security & permissions.
      3. Under QuickSight access to AWS services, select Manage.
      4. Select Amazon Athena and the Amazon S3 buckets created by this CDK data lake solution
  4. quicksight permissions screenshot Use the following Launch Stack button to deploy the evaluation form analytics solution in your preferred Region:
    cft stack screenshot
  5. Enter a unique Stack name.
  6. Use the default value of AmazonConnectDataAnalyticsDB for the parameter AwsGlueDatabaseName, or update if you chose a different Glue database name during the data pipeline setup. Choose Next, Next, then Submit.
  7. When the CloudFormation stack creation is complete, on the QuickSight console, choose the user icon (top right) to open the menu, and choose Manage QuickSight.
  8. On the admin page, choose Manage assets, then choose Dashboards.
  9. Select <stack-name>-EvaluationFormAnalytics_v1 and choose Share.
  10. Optionally, to customize the dashboard further, share <stack-name>-EvaluationFormAnalytics_v1 under Asset type Analyses and <stack-name>-EvaluationFormAnalytics_v1 under Datasets.
  11. Enter the QuickSight user or group and choose Share again.

Steps to test

  1. Download the `contact-flows/SimpleInboundFlow` contact flow from the repo. Navigate to Routing, then Flows. Choose Create flow. When the flow designer loads, select the down arrow and select Import. Select the SimpleInboundFlow and import it in your Amazon Connect instance.
  2. Navigate to Channels, Phone numbers. Associate a phone number to the SimpleInboundFlow flow.
  3. Create an evaluation form by navigating to Analytics and optimization, Contact Lens, Evaluation forms. See the documentation Create an evaluation form for more information.
  4. Sign into your Connect instance as an agent and open the Contact Control Panel (CCP). Call the phone number as a customer. You can choose any of the IVR options and then be routed to an agent. Pick up the call on the CCP and emulate a short contact center conversation.
  5. After you end the call, on the Connect navigation pane, choose Analytics and optimization, Contact search, and then search for the contact that you want to evaluate. Click into the Contact details page, choose Evaluations or the < icon.
  6. To start an evaluation, choose an evaluation from the dropdown menu, and then choose Start evaluation. Fill out the evaluation form and click Submit.
  7. Check that the Kinesis Data Firehose files were created in the S3 destination buckets for both the CTR and EF. It might take up to 3 minutes for the evaluation form data to appear in the destination bucket.
    1. The processed records will be written to the destination bucket amazonconnectdataanalyticssample-ef-<account-id>-<region>.
    2. Note that amazonconnectdataanalyticssample-ef-al-<account-id>-<region> with an extra “al” indicates the access log bucket.
  8. Navigate to the Amazon Athena Query editor. In the section Tables, select the three dots next to connect_ef and click Load partitions. Amazon Athena will run MSCK REPAIR TABLE `connect_ef` to load new partitions.
  9. Repeat the same steps with the connect_ctr table: Select the three dots next to connect_ctr table and click Load partitions.
    1. Note: Normally, the partitioning process runs daily at midnight to bring in the data from the previous day. To see the results immediately, We are importing the data manually.
  10. The QuickSight dashboard will render the evaluation form data in a few minutes. Navigate to QuickSight, Dashboards, and select <stack-name>-EvaluationFormAnalytics_v1.

Sample dashboard overview

The Team view provides a high-level overview of the evaluation forms. It shows the overall and average evaluation score, and even includes a word cloud showcasing sample answers. If you require detailed, comprehensive analysis of the evaluation form, then the tabular view is the perfect option. This view offers a breakdown of the evaluation form question, value, and count score. You can apply custom filters to create your own views.

QuickSight dashboard "Teams" tab screenshot.

The Agent view provides a high-level analytics for your contact center agents. This view includes an evaluation form score breakdown, which allows you to identify top-performing agents and areas where coaching may be required. The ability to apply filters based on criteria such as Agent, Queue, and Routing Profile makes it easier to narrow down your search and find the relevant data you need.

Agent quicksgith dashboard

The Evaluator view provides a comprehensive high-level overview of the evaluators in your contact center. You’ll find visualizations that showcase the total number of evaluations performed as well as the average score for each form. Additionally, the Sankey diagram highlights which evaluator completed each evaluation form visually.

QuickSight dashboard evaluator tab screenshot

Cleanup

In order to delete the resources created by in this blog:

  1. Delete the CloudFormation template.
  2. Empty and delete the S3 bucket created from the CloudFormation template.
  3. Delete the Glue database created from the CloudFormation template.

To remove the CDK data pipeline solution from your account, follow these steps:

  1. Remove CDK Stacks:
    1. In your terminal, navigate to amazon-connect-data-analytics-sample/cdk-stacks.
    2. Run cdk destroy --all.
  2. Remove deployment parameters from AWS System Manager Parameter Store:
    1. In your terminal, navigate to amazon-connect-data-analytics-sample/cdk-stacks.
    2. Run node configure.js -d.

Conclusion

In this blog, you learned how to stream Contact Records and evaluation form data using Amazon Kinesis and Amazon EventBridge. We also demonstrated how to visualize this data using QuickSight dashboards. For further insights and analytics capabilities on Amazon Connect data sources, check out the Amazon Connect Reporting blog series.

Author Bio

Karletha Paxton is a Senior Solutions Architect at AWS specialized in Amazon Connect. She has over 20 years in contact center experience in design and implementing innovative strategies that deliver customized cloud-based solutions to help some of the largest organizations in the world modernize customer experience.
Angela Yu is a Solutions Architect at AWS specializing in building for Productivity Applications. She has over 10 years of development experience and is passionate about enabling customers to use Connect by building the art of the possible.
Mehmet Demir is a Principal Solutions Architect at Amazon Web Services (AWS) based in Toronto, Canada. He helps customers in building well-architected solutions that support business innovation
Ankur Taunk is a Senior Specialist Solutions Architect at AWS. He helps customer achieve their desired business outcomes in the Contact Center space leveraging Amazon Connect.
Anshika Singh is an Associate Solutions Architect on the Builder team based out of New York, New York. She helps enable customers to use the cloud through the use of code samples and starter projects.
Manoj Srinivas is a Senior Solutions Architect at AWS based out of Dallas, Texas. He works with various businesses to accelerate their adoption of cloud contact center solution through Amazon Connect. He is passionate about Identity, Security and Unified Communications.