Skip to main content

Amazon Connect Historical Metrics in Salesforce

Amazon Connect can generate a number of historical metric reports to monitor efficiency and utilization, agent performance, and other information about your contact center. Amazon Connect provides you the ability to schedule execution and export of reports, in comma separated value (CSV) format, to the S3 bucket of your choice. This enables broad compatibility across many analytics and WFM tools.

With the AWS Serverless Repository for Salesforce, you can configure the automatic import of reporting data from Amazon Connect into Salesforce. Two different historical reports are available to transport Agent and Queue interval data from Amazon Connect to Salesforce. Once these have been configured and scheduled, you will begin to see data available in the reports that have been included with the CTI Adapter.

Configuring the AWS Services#

When you configure schedule reports to run in Amazon Connect, they are saved to your reporting Amazon S3 bucket upon execution. As a part of the schedule configuration, you can determine the frequency with which data is exported. The standard configuration is for execution every 30 minutes; however you can increase the interval time to suit your requirements.

Once you have the reports configured and scheduled, you will then need to activate the trigger for the reports bucket that will invoke an AWS Lambda function included in the AWS Serverless Repository for Salesforce. This function will process the report and import the data to Salesforce.

Configuring the Historical Reports in Amazon Connect#

  1. Login to your Amazon Connect instance as an Administrator

  2. From the left navigation, choose Metrics and Quality then select Historical metrics

  1. On the Historical metrics page, select Contact metrics
  1. Once the Historical metrics: Queues report loads, select the cog in the upper right to edit the report

  2. On the Interval & Time range tab, set the parameters as follows:

    a. Interval: 30 minutes

    b. Time Zone: UTC

    c. Time Range: Last 24 Hours

  3. Leave the Groupings and Filters tabs set to their defaults

  4. Select the Metrics Tab.

  5. Select ALL selectable options

  6. Select Apply

  7. Once the report saves, select the dropdown menu next to the Save button and choose Schedule

  8. Set the name as sfIntervalQueue and choose Continue

  9. On the Note screen, choose Continue

  10. On the Recurrence tab in the Schedule Report setup, set the options as:

    a. Generate this report: Hourly

    b. Every: 0.5 hour(s)

    c. Starting at: 1AM

    d. For the Previous: 0.5 hour(s)

  1. Select the Delivery Options tab

  2. In the Prefix field, enter SFDC/Queue

  1. Note the File name. The file name contains the bucket, path, and filename that will be used when executing the report. You will use the bucket name and path in later steps.
  1. Choose Create

  2. Once the report is created, from the left navigation, choose Metrics and Quality then select Historical metrics

  1. On the Historical metrics page, select Agent performance
  1. Once the Historical metrics: Agents report loads, select the cog in the upper right to edit the report

  2. On the Interval & Time range tab, set the parameters as follows:

    a. Interval: 30 minutes

    b. Time Zone: UTC

    c. Time Range: Last 24 Hours

  3. Leave the Groupings and Filters tabs set to their defaults

  4. Select the Metrics Tab.

  5. Select the following metrics (deselect any others):

Note You should be able to use all metrics, but these are the important ones.

-   After contact work time
-   Agent on contact time
-   Agent idle time
-   Non-Productive Time
-   Average after contact work time
-   Average handle time
-   Average customer hold time
-   Average agent interaction and customer hold time
-   Average agent interaction time
-   Contacts agent hung up first
-   Contacts handled
-   Contacts handled incoming
-   Contacts handled outbound
-   Contacts put on hold
-   Contacts hold disconnect
-   Contacts transferred out
-   Contacts transferred out internal
-   Contacts transferred out external
-   Error status time
-   Agent answer rate
-   Agent non-response
-   Occupancy
-   Online time
-   Agent interaction and hold time
-   Agent interaction time
-   Average outbound agent interaction time
-   Average outbound after contact work time
  1. Select Apply

  2. Once the report saves, select the dropdown menu next to the Save button and choose Schedule

  3. Set the name as sfIntervalAgent and choose Continue

  4. On the Note screen, choose Continue

  5. On the Recurrence tab in the Schedule Report setup, set the options as:

    a. Generate this report: Hourly

    b. Every: 0.5 hour(s)

    c. Starting at: 1AM

    d. For the Previous: 0.5 hour(s)

  1. Select the Delivery Options tab

  2. In the Prefix field, enter SFDC/Agent

  1. Note the File name. The file name contains the bucket, path, and filename that will be used when executing the report. You will use the bucket name and path in later steps.
  1. Choose Create

Once you have created the two reports and set their schedule, the next thing you will need to do is to configure a trigger that executes a Lambda function when the report is generated and stored in S3.

Creating the AWS Lambda Trigger for the Queue Data#

  1. In a new browser tab, login to the AWS console

  2. Open the AWS Lambda Console

  3. In the Add filter field of the AWS Lambda console, enter sfIntervalQueue and press enter to filter the list of functions

  4. Select the Lambda function that includes sfIntervalQueue in the name

  5. Expand the Designer section

  6. Select Add trigger

  1. In Trigger configuration, select S3 from the dropdown list
  1. Referring to the notes from the report configuration earlier, select the appropriate bucket

  2. Change the Event type to PUT

  3. Referring to the notes from the report configuration earlier, set the Prefix to the path value for your report

  4. Set the Suffix to .csv

  5. The trigger configuration should now be similar to the following:

  1. Select Add

  2. If everything has been configured correctly, you should receive a success message.

Creating the AWS Lambda Trigger for the Agent Data#

  1. In a new browser tab, login to the AWS console

  2. Open the AWS Lambda Console

  3. In the Add filter field of the AWS Lambda console, enter sfIntervalAgent and press enter to filter the list of functions

  4. Select the Lambda function that includes sfIntervalAgent in the name

  5. Expand the Designer section

  6. Select Add trigger

  1. In Trigger configuration, select S3 from the dropdown list
  1. Referring to the notes from the report configuration earlier, select the appropriate bucket

  2. Change the Event type to PUT

  3. Referring to the notes from the report configuration earlier, set the Prefix to the path value for your report

  4. Set the Suffix to .csv

  5. The trigger configuration should now be similar to the following:

  1. Select Add

  2. If everything has been configured correctly, you should receive a success message.

Verifying the Data Import in Salesforce#

Once you have configured the reports and added the triggers, you should start to see data in Salesforce after ~30 minutes. The Amazon Connect CTI Adapter comes with a predefined set of reports. These reports can be customized and additional reports can be created by leveraging the imported data.

Viewing Amazon Connect Reports in Salesforce#

  1. Log in into your Salesforce org and go to the Service Console

  2. Expand the navigation menu by selecting the down arrow and choose Reports

  3. In the left Navigation, select All Folders

  4. Select the Amazon Connect Reports folder

  1. In the list of reports, choose Average Handle Time queue report
  1. Once the report loads, you should see data (provided calls have queued in this Amazon Connect instance today)