- Newest
- Most votes
- Most comments
To implement persistent chat in Amazon Connect flows using the "Create Persistent Contact Association" block and track chat logs, follow these steps:
-
Retrieving and passing the source contact ID:
- You're correct that the source contact ID should not be the same as the current contact ID. To retrieve the previous contact ID, you'll need to store it somewhere (like DynamoDB) when the chat ends and retrieve it when a new chat starts.
- Use a "Set contact attributes" block before the "Create persistent contact association" block to set a user-defined attribute with the retrieved source contact ID.
-
Testing persistent chat functionality:
- Create a test flow that includes the "Create persistent contact association" block.
- Initiate a chat, have a conversation, end the chat, then start a new chat with the same customer.
- Verify that the previous conversation is displayed in the new chat session.
-
S3 bucket configurations:
- Ensure your Amazon Connect instance has the necessary permissions to access the S3 bucket where chat transcripts are stored.
- Configure appropriate bucket policies and encryption settings as per your security requirements.
-
Best practices:
- Use the ENTIRE_PAST_SESSION rehydration type to resume the full chat history.
- Implement error handling in your flow to manage cases where the source contact ID is not found or invalid.
- Consider using Lambda functions for more complex logic in retrieving and managing source contact IDs.
-
Tracking chat logs and events:
- Enable contact flow logs in your Amazon Connect instance settings.
- Use Amazon CloudWatch to monitor these logs in real-time.
- Set up CloudWatch Alarms to alert you of any issues or errors in your flows.
- Consider using Amazon Connect Streams API to capture detailed chat events on your website.
-
Resolving the error:
- The error you're seeing is likely because you're using the current contact ID as the source contact ID.
- Implement a system to store and retrieve previous contact IDs for each customer, possibly using a database like DynamoDB.
- Use a Lambda function or external data lookup to fetch the correct previous contact ID before the "Create persistent contact association" block.
Remember to thoroughly test your implementation and monitor logs to ensure the persistent chat is working as expected. If issues persist, review your flow logic and data storage/retrieval methods for previous contact IDs.
Sources
Enable customers to resume chat conversations in Amazon Connect - Amazon Connect
Flow block in Amazon Connect: Create persistent contact association - Amazon Connect
PersistentChat - Amazon Connect
The chat/SMS channel in Amazon Connect - Amazon Connect
Please note that you will need to implement a repository to store and retrieve the previous contact id which is required in the "Use attribute" section of the "Create persistent contact association" flow block. "Invoke AWS Lambda function" block can be implemented to retrieve the previous contact from an external source.
You may also be required to update the value of previous contact in the repository with the value of current contact ID later in the flow for use as previous contact id in future chat session. Similarly, "Invoke AWS Lambda function" block can be implemented to update contact ID value in the repository.
Please select either of below rehydration types :
-
Please select "ENTIRE_PAST_SESSION" to rehydrate a chat from the most recently terminated past chat contact of the specified past ended chat session. To use this type, provide the initialContactId of the past ended chat session in the sourceContactId field.
-
Alternatively, select "FROM_SEGMENT" to rehydrate a chat from the past chat contact that is specified in the sourceContactId field.
For reference your can review https://docs.aws.amazon.com/connect/latest/adminguide/chat-persistence.html#enable-persistent-chat-within-contact-flow
Relevant content
- asked a year ago
- asked 2 years ago