View a markdown version of this page

Customer profiles contact data in the Connect Customer data lake - Amazon Connect Customer

Customer profiles contact data in the Connect Customer data lake

The following table contains customer profiles contact data.

Customer profiles contact event

Table name: customer_profiles_contact_event

Description: Contains a snapshot of Customer Profiles data for each contact at disconnect time, including calculated attribute values (orders total price value and call count) and segment memberships (lifetime value tier and repeat caller status). One record is created per contact.

Primary key: instance_id, event_id

Partition key: initiation_timestamp (daily)

Join keys:

  • instance_id — Joins to all tables

  • contact_id — Joins to Contact Record, Contact Statistic Record, Contact Evaluation Record, Contact Lens, Contact Flow Events, AI Agent, AI Session

Column Type Nullable Description
instance_id string No The ID of the Connect Customer instance.
event_id string No The ID of the customer profiles contact event.
aws_account_id string No The ID of the AWS account that owns the contact.
instance_arn string No The ARN of the Connect Customer instance.
contact_id string No The ID of the contact this snapshot is associated with.
profile_id string No The Customer Profile ID associated with this contact at disconnect time.
domain_name string No The Customer Profiles domain identifier.
initiation_timestamp Timestamp No The contact initiation Timestamp. Used as partition key. Never changes after creation.
disconnect_timestamp Timestamp Yes The contact disconnect Timestamp.
event_timestamp Timestamp No Timestamp when this snapshot record was generated or last updated.
orders_total_price_sum double Yes The sum of order values associated with the customer profile.
call_count bigint Yes The number of distinct calls a customer has made in the configured time period (7 days by default, which you can update in Customer Profiles).
lifetime_value_segment array(string) No Lifetime value segment memberships at disconnect time. Possible values: _default_lifetime_value_high, _default_lifetime_value_medium, _default_lifetime_value_low.
repeat_caller_segment array(string) No Repeat caller segment memberships at disconnect time. Possible values: _default_repeat_caller, _default_non_repeat_caller.
data_lake_last_processed_timestamp Timestamp Yes Timestamp showing the last time the data lake processed the record. Cannot reliably be used to determine data freshness.

Things to know

  • One record is expected per contact at disconnect time.

  • The initiation_timestamp is the partition key and never changes, even if the record is updated. Use this field for efficient time range queries.

  • Segment columns (lifetime_value_segment and repeat_caller_segment) contain the segment names the customer matched at disconnect time. These are separate columns to support independent filtering and grouping in analytics.

  • Default segment thresholds for lifetime value can be customized by modifying the underlying calculated attributes in Customer Profiles.

Sample queries

The following example query in Amazon Athena returns customer profiles contact events for a specific instance:

SELECT contact_id, profile_id, orders_total_price_sum, call_count, lifetime_value_segment, repeat_caller_segment, disconnect_timestamp FROM "customer-profiles-contact-event-resource-link-table-name" WHERE instance_id = 'your-instance-id' AND initiation_timestamp >= TIMESTAMP 'start-date' AND initiation_timestamp < TIMESTAMP 'end-date' ORDER BY initiation_timestamp DESC;

The following example query in Amazon Athena joins customer profiles data with contact records:

SELECT cr.contact_id, cr.agent_username, cr.queue_name, cr.agent_interaction_duration_ms, cp.lifetime_value_segment, cp.repeat_caller_segment, cp.orders_total_price_sum FROM "contact-record-resource-link-table-name" cr JOIN "customer-profiles-contact-event-resource-link-table-name" cp ON cr.instance_id = cp.instance_id AND cr.contact_id = cp.contact_id WHERE cr.instance_id = 'your-instance-id' AND cr.initiation_timestamp >= TIMESTAMP 'start-date' AND cr.initiation_timestamp < TIMESTAMP 'end-date';