

# Use Identity Resolution to consolidate similar profiles in Amazon Connect
Use Identity Resolution to consolidate similar profiles

A *similar profile* is when two or more profiles are determined to be for the same contact. There can be multiple profiles when customer records are captured across multiple channels and applications for the same customer, and do not share a common unique identifier.

Identity Resolution automatically finds similar profiles and helps you consolidate them. It runs an Identity Resolution Job on a weekly basis, which performs the following steps:

1. [Automatic profile matching](how-identity-resolution-works.md#auto-profile-matching) 

1. [Automatic merging of similar profiles](how-identity-resolution-works.md#auto-profile-merging) based on your consolidation criteria 

Each time an Identity Resolution Job runs, it displays metrics on the **Customer Profiles** page. The metrics show the number of profiles it reviewed, the number of match groups found, and the number of profiles consolidated. 

Additional charges may apply for enabling Identity Resolution. For more information, see [Amazon Connect pricing](https://aws.amazon.com/connect/pricing/). 

![\[The Amazon Connect Customer Profiles page, the Enable Identity Resolution button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-enable-ir.png)


# Enable Identity Resolution for your Amazon Connect Customer Profiles domain
Enable Identity Resolution

**Important**  
Amazon Connect Cases is not fully compatible with Amazon Connect Customer Profiles Identity Resolution when using the Agent Workspace. Here's what happens to existing cases when profiles are merged:  
Cases remain tied to their original profile ID after a merge.
Cases do not automatically consolidate across merged profiles.
There is no supported method to re-associate an existing case to another profile. Use [CreateCase](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateCase.html) and [CreateRelatedItem](https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_CreateRelatedItem.html) as a workaround if you need to consolidate cases manually.

When you enable Identity Resolution you specify the following information:
+ When the Identity Resolution Job should run on a weekly basis. By default, it runs Saturdays at 12AM UTC.
+ The Amazon S3 bucket where the Identity Resolution Job should write the results of the automatic profile matching process. If you don't have an S3 bucket, you'll have the option to create one during the enablement process. 

  You can query the Amazon S3 bucket or use the [GetMatches](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html) API to filter results based on [confidence scores](how-identity-resolution-works.md#confidence-score).

After you enable Identity Resolution you'll see the option to [create consolidation criteria](create-consolidation-criteria.md) for the optional auto-merging process.

**To enable Identity Resolution**

1. You must have a Customer Profiles domain enabled for your instance. For instructions, see [Enable Customer Profiles for your Amazon Connect instance](enable-customer-profiles.md).

1. In the navigation pane, choose **Customer profiles**.

1. In the **Identity Resolution** section, choose **Enable Identity Resolution**.  
![\[The Amazon Connect Customer Profiles page, the Enable Identity Resolution button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-enable-ir.png)

1. In the **Identity Resolution** pop-up box, choose **Enable Identity Resolution**.  
![\[The Amazon Connect Customer Profiles page, the Enable Identity Resolution button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-enable-ir-2.png)

1. On the **Enable Identity Resolution** page, specify the date and time when you want the Identity Resolution Job to run.

1. If you want to review the matched profile IDs from an Amazon S3 bucket, select **Write profile ID matches to Amazon S3**. Otherwise, you can use the [GetMatches](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html) API to review matching profiles. 
**Note**  
If you auto-enable merges, you will not receive matched profile IDs.

   1. Specify the Amazon S3 bucket where the Identity Resolution Job should write the profile matches.

     We recommend applying a policy to prevent a confused deputy security issue. For more information and a sample policy, see [Amazon Connect Customer Profiles cross-service confused deputy prevention](cross-service-confused-deputy-prevention.md#customer-profiles-cross-service).

1. When done, choose **Enable Identity Resolution**. Both rule-based matching and ML-based matching are enabled after you enable Identity Resolution. You can disable one of them or both from the Identity Resolution page. For more information, see [Disable Identity Resolution in Amazon Connect Customer Profiles](disable-identity-resolution.md).

1. Rule-based matching for Identity Resolution:

   1. After you enable the rule-based matching with a new domain the matching will start immediately if you set up an integration and the integration is running.

   1. After you enable the rule-based matching with an existing domain, the matching process will start within one hour.

1. ML-based matching for Identity Resolution:

   1. After you enable Identity Resolution the Identity Resolution Job runs for the first time within 24 hours.
**Note**  
Before running an Identity Resolution Job for the first time on a new Customer Profiles domain, we recommend checking your profile metrics to make sure that profiles have been created. Otherwise, there won't be any matching results.

   1. You may want to set up consolidation criteria for auto-merging matching profiles. If so, see [Set up consolidation criteria for Identity Resolution in Amazon Connect](create-consolidation-criteria.md).

# Set up consolidation criteria for Identity Resolution in Amazon Connect
Set up consolidation criteria

**Note**  
You must [enable Identity Resolution](#create-consolidation-criteria) in order to access the option to create consolidation criteria using the Amazon Connect admin console. 

When similar profiles are detected by an Identity Resolution Job, the process can automatically merge them into a unified profile based on consolidation criteria that you specify. 

The attributes that you select are compared across all similar profiles in a match group for exact match. For example, if you specify `email` as an attribute in the criteria, then all similar profiles in a match group that have exact same value of `email address` are merged into a unified profile. 

**Tip**  
If you want to set up your own merging logic, use the [MergeProfiles](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_MergeProfiles.html) API.

## Limits


You can select any attribute from the [standard profile](standard-profile-definition.md) to compare similar profiles. For example, you might choose phone number, email address, and name, as well as custom attributes. 

You can specify up to: 
+ 10 consolidation criteria
+  20 attributes per criteria

## Tips for creating strong criteria


To improve the targeting of unique profiles and to avoid consolidating profiles that are not duplicates, we recommend the following steps:
+ Select attributes that can uniquely identify a customer and are not likely to be the same across customers, such as an account number or a form of government ID.
+ Avoid single attribute criteria. Select multiple attributes to create a combination of attributes to improve targeting. For example:
  + **Phone number** with **First name**, **Middle name**, **Last name** is stronger criteria

  than
  + **Phone number** alone, or 
  + The combination of **First name, Middle, name, Last name** alone
+ Select all attributes within a specific attribute group, when applicable. For example, if you want to use name, select all the related name attributes: **First name, Middle name, Last name**. If you want to use business address, select all the related business address attributes. 
+ Include one of the following attributes likely to uniquely identify a customer in combination with other attributes in the criteria:
  + Account number
  + Phone number
  + Email

## How to set up auto-merging criteria


Before setting up your consolidation criteria for automatic merging, or auto-merging, we recommend reviewing [How the auto-merging process works](how-identity-resolution-works.md#consolidation-criteria-how-it-works).

1. After you enable Identity Resolution, on the **Identity Resolution** page you'll have the option of setting up auto-merging criteria. Choose **Create consolidation criteria**.

1. If you receive a **Missing timestamp** dialog box, we recommend adding new timestamp attributes to your custom object types before continuing. See [Missing timestamp for profile conflicts](#missing-timestamp-for-profile-conflicts). 

1. In the **Profile conflicts** section, choose how profile conflicts should be resolved when two or more records have conflicts.

1. In the **Consolidation criteria** section, create one or more criteria. We recommend including at least two or more attributes per criteria.

## Missing timestamp for profile conflicts


The **Missing timestamp** message is displayed if you have custom object type mappings.

Use the [PutProfileObjectType](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObjectType.html) API to add the following new attributes to your custom object type: 
+ `Fields.sourceLastUpdatedTimestamp`
+ `sourceLastUpdatedTimestampFormat`

If the timestamp attribute is not specified, you can continue to create consolidation criteria, however, a default timestamp of when the records were ingested into Customer Profiles is used. We recommend adding the new attributes before creating your consolidation criteria.

If you have already defined a custom object type and want to update your custom object type, we run a scheduled backfill every week to update your existing profiles with the `Fields.sourceLastUpdatedTimestamp`. To opt in to the scheduled backfill:

1. Update your custom profile object type by using the [PutProfileObjectType](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObjectType.html) API.

1. After you update your custom profile object type, open an [Support ticket](https://console.aws.amazon.com/support/home) and we’ll schedule the backfill for you. The scheduled backfill runs until end of February 2022.

Alternatively, you can delete and then re-create the ingestion/connector you have for your domain that uses the custom object type. All of your data will be re-ingested using your updated object type and `Fields.sourceLastUpdatedTimestamp` will be parsed from it.

## Example: How sample criteria are applied


In this example there are three criteria: 
+ **Resolve profile conflicts** is set to **Use last updated timestamp**. This means when two fields have conflicting values, Identity Resolution is going to use the last updated timestamp to determine which value to use.
+ Criteria 1: 
  + First name, Last name
  + Email
+ Criteria 2: 
  + Phone number

These criteria are applied to the following profiles:
+ Profile A
  + John Doe [last updated **05:00**a]
  + doefamily@anyemail.com [last updated **05:00**a]
  + 555-555-5555 [last updated **07:00**a]
+ Profile B
  + John Doe [last updated **04:00**a]
  + doefamily@anyemail.com [last updated **06:00**a]
  + 555-555-555**6** [last updated *04:00*a]
+ Profile C
  + **Jane** Doe [last updated **06:00**a]
  + doefamily@anyemail.com [last updated **07:00**a]
  + 555-555-5555 [last updated **06:00**a]

Following are the results when Criteria 1 is applied:
+ Profile A and B are merged = Profile AB

This results in ProfileAB, which looks like the following:
+ John Doe [last updated **05:00**a]
+ doefamily@anyemail.com [last updated **07:00**a]
+ 555-555-555**5** [last updated **06:00**a]

Because there's a conflict between the phone numbers, Identity Resolution uses the last timestamp to choose the 555-555-555 number.

Next, Criteria 2 is applied. Following are the results:
+ Profile AB and C are merged = Profile ABC

This results in Profile ABC, which looks like the following:
+ **Jane** Doe [last updated **06:00**a]
+ doefamily@anyemail.com [last updated **07:00**a]
+ 555-555-555**5** [last updated **07:00**a]

Identity Resolution uses the First name, Last name, and Email from Profile C because they have the most recent timestamps. 

# Machine learning for Identity Resolution in Amazon Connect
Machine learning for Identity Resolution

Identity Resolution in Amazon Connect automatically finds similar profiles and helps you consolidate them. The topics in this section describe how to set up machine learning matching to consolidate duplicate profiles as part of the automatic merging process.

**Topics**
+ [How machine learning Identity Resolution works](how-identity-resolution-works.md)
+ [Set up machine learning for Identity Resolution](setup-machine-learning-matching.md)

# How machine learning Identity Resolution works in Amazon Connect
How machine learning Identity Resolution works

This topic describes how Identity Resolution performs automatic profile matching, and if set up, how it automatically merges similar profiles.

## Automatic profile matching
Automatic profile matching

To identify similar profiles, Identity Resolution uses machine learning to review the following Personal Identifiable Information (PII) attributes in each profile: 
+ Name: All names are reviewed for similarity, including first name, middle name, and last name.
+ Email: All email addresses are reviewed for similarity, including personal email and business email. They are not case sensitive.
+ Phone number: All phone numbers and formats are reviewed for similarity, including home phone, mobile phone, and business phone.
+ Address: All address types and format are reviewed for similarity, including business address, mailing address, shipping address, and billing address.
+ Date of birth: All birth dates and formats are reviewed for similarity.

It uses this information to create match groups of similar profiles. 

### Match groups


A match group consists of all similar profiles which represents a customer. Each match group contains the following information:
+ A match ID, which uniquely identifies the group of two or more similar profiles that represent a contact
+ The number of profile IDs in the match group
+ A confidence score associated with the match group

### Confidence scores


After the auto-matching process runs, you can query the S3 bucket or use the [GetMatches](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html) API to filter results based on confidence scores. For example, you can filter out high confidence matches for a further review.

A confidence score is a number between 0 and 1 that represents the confidence level of assigning profiles to a match group. A score of 1 likely indicates an exact match. 

## Automatic merging of similar profiles
Automatic merging of similar profiles

After the profiles are matched, the Identity Resolution Job can optionally merge similar profiles based on your criteria. If you delete or update criteria, the updated criteria is applied to similar profiles in the next run.

**Important**  
You cannot undo the consolidation process. We strongly recommend using the [GetAutoMergingPreview](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetAutoMergingPreview.html) API to do a dry run of the automatic merging process before running the Identity Resolution Job.

**Note**  
When merging two profiles, profile fields manually populated through an API call or the Agent Workspace will not be overwritten by profile fields automatically ingested from an integration or custom object type mapping.  
For example, suppose a profile is created with FirstName “John” manually by an agent in the Agent Workspace. Another profile is created using an S3 integration with FirstName “Peter”. If these profiles are automatically merged, the FirstName “John” will be preserved.

### How the auto-merging process works

+ **All selected attributes in a consolidation criteria are connected with `AND` criteria with exact value comparison before merging**. 
  + For example, when multiple attributes are specified in the criteria, such as `email address` and `phone number`, then all similar profiles in a match group that have the exact same value of `email address` and `phone number` are merged.
  + If one or more of the similar profiles in a match group have a different value or missing value for one or more of the attributes in a criteria, the similar profiles are merged. 

    For example, one match group may be five similar profiles out of which three profiles are consolidated, because these three profiles meet the criteria. The other two profiles are not merged, because they do not meet the criteria.
+ **Multiple criteria are evaluated in the order of priority starting with Criteria 1**. 
  +  The sequence in which consolidation criteria are applied. It starts with Criteria 1 as the highest priority to Criteria 10 as the lowest priority. 
  + After the Identity Resolution Job applies one criteria, it applies the next criteria to the consolidated profiles and the remaining similar profiles in a match group. 
  + You can have a maximum of 10 consolidation criteria.
+ **Each criteria runs independently and operates as an `OR` with other criteria**. 
  + When you have multiple criteria, each criteria is applied individually and in the sequence of priority order before the Identity Resolution Job moves on to the next criteria.
  + All criteria is applied in the sequence in which you listed them. It doesn't matter whether the criteria fails or succeeds to consolidate similar profiles in a match group.
+ **By default, profile conflicts are managed by recency**. 
  + When two or more similar profiles in a match group meet a consolidation criteria, the resulting consolidated profile is created by comparing each value of the profile attributes constituent similar profiles.
  + Each attribute may have an exact match in value. In this case, any value may be selected for that attribute.
  + If there is a conflict between values of two or more constituent similar profiles, the most recently updated attribute is chosen. 

    For example, if Jane Doe has three different values in the `Address` attribute of the constituent similar profiles, Identity Resolution picks the most recent addressed to create the unified profile.
  + By default, the **Last updated timestamp** is used to determine the record that was most recently updated.
+ **Profile conflicts are managed by source object type and recency**. 
  + You can also change default behavior of conflict resolution to choose a similar constituent profile from a specific source as the source of truth to inform conflict resolution.
  + If you want to specify a data source to use for profile conflicts, you can choose one of your object types as a data source if you select **Source with last updated timestamp**. 
  + The most recently updated record from the specified object type is used for resolving profile conflicts. 
+ **Last updated timestamp identifies which record was most recently updated**. 
  + The timestamp attribute associated with the source record’s object type is used to identify which record was most recently updated.
  + If the timestamp attribute is not available for the object type, the timestamp on which the record was ingested into your Customer Profiles domain is used. 
  + If you have custom object types, you need to add timestamps. See [Missing timestamp for profile conflicts](create-consolidation-criteria.md#missing-timestamp-for-profile-conflicts) for more information. 
+ **Consolidation is a one-way process and cannot be undone**. 
  + Choose your criteria carefully before starting the consolidation process. For more information, see [Tips for creating strong criteria](create-consolidation-criteria.md#tips-for-creating-consolidation-criteria).
  + Use the [GetAutoMergingPreview](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetAutoMergingPreview.html) API to test the auto-merging settings of your Identity Resolution without merging your data. 

For an example that shows how criteria is applied, see [Example: How sample criteria are applied](create-consolidation-criteria.md#criteria-examples).

# Set up machine learning for Identity Resolution in Amazon Connect
Set up machine learning for Identity Resolution



## Edit machine learning matching run schedule


![\[Edit machine learning matching run schedule.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/machine-learning-ir-edit-run-schedule.png)


## Edit machine learning merge matches


![\[Edit machine learning merge matches.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/machine-learning-ir-edit-merge-matches.png)


## Edit machine learning match location


![\[Edit machine learning match location.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/machine-learning-ir-edit-match-location.png)


# Rule-based matching for Identity Resolution in Amazon Connect
Rule-based matching for Identity Resolution

Identity Resolution in AC automatically finds similar profiles and helps you consolidate them. The topics in this section describe how to set up rule-based Identity Resolution to consolidate duplicate profiles as part of the automatic merging process.

**Topics**
+ [How rule-based Identity Resolution works](how-rule-based-identity-resolution-works.md)
+ [Set up rule-based matching for Identity Resolution](setup-rule-based-matching.md)
+ [Set up matching rules for rule-based Identity Resolution](setup-matching-rule-examples.md)

# How rule-based Identity Resolution works in Amazon Connect
How rule-based Identity Resolution works

This topic describes how rule-based Identity Resolution performs automatic profile matching and how it automatically merges similar profiles.

## Automatic profile matching


To identify similar profiles, the rule-based Identity Resolution uses a list of [ matching rule attributes](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_MatchingRule.html) to match each profile. Up to 15 MatchingRule attributes are supported in the [MatchingRules](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_RuleBasedMatchingRequest.html#customerprofiles-Type-RuleBasedMatchingRequest-MatchingRules).

### Matching rules


The following is a list of the [ MatchingRule](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_MatchingRule.html) attributes that can be used. You can configure up to 15 matching rule levels. For each matching rule, you can use the following Personal Identifiable Information (PII) attributes in each profile:
+ **AccountNumber**
+ **Address.Address**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.City**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.Country**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.County**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.PostalCode**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.State**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **Address.Province**: All addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including Address, BusinessAddress, MaillingAddress, and ShippingAddress
+ **PhoneNumber**: The phone numbers specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including PhoneNumber, HomePhoneNumber, and MobilePhoneNumber.
+ **EmailAddress**: All email addresses specified in the [Attribute Type Selector](#rule-based-attribute-type-selector) are reviewed for similarity, including EmailAddress, BusinessEmailAddress, and PersonalEmailAddress
+ **BirthDate**
+ **BusinessName**
+ **FirstName**
+ **LastName**
+ **MiddleName**
+ **Gender**
+ **Any customized profile attributes with the *Attributes* prefix**

Matching rules are processed by priority. For example, the first rule should be the most optimized rule you want to define and should be used to achieve the most accurate result. 

### Attribute Type Selector


The Attribute Types Selector holds vital configuration information for rule-based identity resolution, facilitating profile matching. This allows you to fine-tune the comparison of profiles across attribute types and select the key attributes for matching within each type. Within this feature, you have the flexibility to configure three distinct attribute types, enabling precise control over the matching process.
+ **Email type**
  + You can choose from EmailAddress, BusinessEmailAddress, and PersonalEmailAddress
+ **PhoneNumber type**
  + You can choose from PhoneNumberNumber, HomePhoneNumber, and MobilePhoneNumber
+ **Address type**
  + You can choose from Address, BusinessAddress, MaillingAddress, and ShippingAddress

You can either choose `ONE_TO_ONE` or `MANY_TO_MANY` as the AttributeMatchingModel. When choosing `MANY_TO_MANY`, the system can match attributes across the sub-types of an attribute type. For example, if the value of the EmailAddress field of Profile A and the value of BusinessEmailAddress field of Profile B matches, the two profiles are matched on the EmailAddress type. When choosing `ONE_TO_ONE`, the system can only match if the sub-types are exact matches. For example, only when the value of the EmailAddress field of Profile A and the value of the EmailAddress field of Profile B matches, the two profiles are matched on the EmailAddress type.

**Max allowed rule level for matching**

You can configure the max rule level you want to use to match similar profiles. For example, if your max allowed rule level for matching is 5, the system will not find similar profiles using the rule level 6.

### Match groups


A match group consists of all similar profiles which represent a customer. Each match group contains the following information:
+ A match ID, which uniquely identifies the group of two or more similar profiles that represent a contact
+ The number of profile IDs in the match group

### Match status

+ **PENDING**

  The first status after the configuration of a rule-based Matching rule. If it is an existing domain, the rule-based Identity Resolution waits 1 hour before creating the matching rule. If it is a new domain, the system will skip the **PENDING** stage.
+ **IN\$1PROGRESS**

  The system is creating the rule-based Matching rule. Under this status, the system is evaluating the existing data and you can no longer change the rule-based matching configuration.
+ **ACTIVE**

  The rule is ready to use. You can change the rule a day after the status is in an **ACTIVE** state.

### How the auto-matching process works


After you create a new Amazon Connect Customer Profiles domain with the rule-based matching rule, the rule-based Identity Resolution will match similar profiles based on the rule you specified while you are ingesting the profiles. If you update the configuration of the rule-based matching, Customer Profiles will start to re-evaluate the profiles in your domain using the new configuration in an hour.

If you are enabling the rule-based matching with an existing domain, the system will move to a **PENDING** state and will start to evaluate the existing profiles in your domain using the new configuration in an hour. The time it takes to finish evaluating profiles is dependant on how many profiles exist.
+ **By default, the default rule will be applied if no custom rule specified.**
  + Amazon Connect Customer Profiles provides a default matching rule if you do not provide a custom matching rule. You can check the custom matching rule here.
+ **All the records will go through the rule-based matching rules.**
  + The system assesses each matching rule level until a match is identified or until the maximum allowed rule level for matching is reached. The evaluation process commences at rule level 1, where the record is analyzed. If no matching group is discovered, the system proceeds to evaluate the subsequent rule levels, searching for a match group until either a match is found or the maximum allowed rule level for matching is reached.
+ **All attributes in a single matching rule level are connected using an *AND* relationship**
  + When multiple attributes are present within a single rule level, they are interconnected by an AND relationship. During profile matching, all attribute values must align for profiles to be assigned to the same match group. For example, only when the values of all attributes are identical, profiles are considered as matches and grouped together for further processing.
+ **All attributes in an attribute type selector are connected with an *OR* relationship**
  + When specifying attributes within the attribute type selector, attributes of the same type are linked through an OR relationship. For instance, consider the PhoneNumber Type where HomePhoneNumber and BusinessPhoneNumber are used. In this scenario, two profiles can be matched if either their HomePhoneNumber or BusinessPhoneNumber aligns. Consequently, the matching process allows for flexible matches based on either home or business phone numbers.
+ **The match result is eventually optimized.**
  + Due to the near real-time nature of profile matching in the system, there is a possibility that a match group for your profile may be found at a lower (less optimized) rule level. Nevertheless, if a match is available at a higher (more optimized) rule level, the system will assign the profile to that particular group.

**Note**  
When Identity Resolution performs rule-based matching, the order in which the rules that you have configured will be processed is dependant on how the data is ingested. For example, If you configure rules 1 and 2, rule 2 might be processed before rule 1. The processing order might change, but the end result will always be the same.

## Automatic merging of similar profiles


After the profiles are matched, the Identity Resolution Job can optionally merge similar profiles based on the [MaxAllowedRuleLevelForMerging](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_RuleBasedMatchingRequest.html) you specify in the rule-based matching configuration.

**Important**  
You cannot undo the consolidation process. It is recommended to turn on matching only first to evaluate the match result using the ListMatches and GetSimiliarProfiles APIs. You can turn on merging by setting the [MaxAllowedRuleLevelForMerging](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_RuleBasedMatchingRequest.html) using the [UpdateDomain](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateDomain.html) API.

**Note**  
When merging two profiles, profile fields manually populated through an API call or the Agent Workspace will not be overwritten by profile fields automatically ingested from an integration or custom object type mapping.  
For example, suppose a profile is created with FirstName “John” manually by an agent in the Agent Workspace. Another profile is created using an S3 integration with FirstName “Peter”. If these profiles are automatically merged, the FirstName “John” will be preserved.

# Set up rule-based matching for Identity Resolution in Amazon Connect
Set up rule-based matching for Identity Resolution



This topic provides an illustrative walkthrough of the steps that you use to edit rule-based matching attribute types, rule-based matching rules, rule-based matching merge rules, and rule-based match locations. It also shows how to reset rule-based matching rules.

## Edit rule-based matching attribute types


![\[Edit rule-based matching attribute types.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rule-based-edit-attribute-types.png)


## Edit rule-based matching rules


![\[Edit rule-based matching rules.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rule-based-edit-matching-rules.png)


## Reset rule-based matching rules


![\[Reset rule-based matching rules.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rule-based-edit-reset-rules.png)


## Edit rule-based matching merge rules


![\[Edit rule-based matching merge rules\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rule-based-edit-merge-rules.png)


## Edit rule-based match location


![\[Edit rule-based match location.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/rule-based-match-location.png)


# Set up matching rules for rule-based Identity Resolution in Amazon Connect
Set up matching rules for rule-based Identity Resolution

## Limits


You can select any attribute from the standard profile to compare similar profiles. For example, you might choose phone number, email address, and name, as well as custom attributes.

You can create a rule-based matching rule with the following limitations:
+ 15 rule levels
+ Each rule level can contain up to 15 profile attributes

## Tips


To improve the targeting of unique profiles and to avoid consolidating profiles that are not duplicates, the following tips are recommended:
+ Include at least one high cardinality attribute that can uniquely identify a customer and that is not likely to be the same across customers, such as a phone number, an email address or an account number.
+ Avoid using profile attributes that can belong to different identities without a high cardinality attribute.
  + **Phone number** with **First name**, **Last name** is a stronger rule than the combination of **First name**, **Last name** alone.
+ If at one rule level, all of the profile attributes of that rule are low cardinality attributes (the attribute that can belong to more than 500 different profiles), Customer Profiles does not attempt to match the profile. You will receive the following SQS message in your DLQ if you setup one during the domain creation:
  + All attributes at rule level x are associated with more than 500 records.
+ Always enable **Match only** first, check the match results, and only enable the merging by setting the **MaxAllowedRuleLevelForMerging** if you are satisfied with the match results.

## Resolve profile conflicts for profile merging


You can define which record to use when the value of an attribute from two or more similar profiles is different, such as conflicting address records.

**Last updated timestamp**

By default, profile conflicts are managed by recency. When there is a conflict between the values of two or more similar profiles, the most recently updated attribute will be chosen.

**Source with last updated timestamp**

Allows you to prioritize records from a specific object type as your data source for managing profile conflicts. When there is a conflict between the values of two or more similar profiles, the most recently updated attribute from the specified object type will be chosen.

If a timestamp is not specified in your object type, the date the record was ingested into Customer Profiles will be used. Source with last updated timestamp is unavailable when you don't have any integrations set up. When you add an integration, your object types will be available as a source for this option. 

## Missing timestamp for profile conflicts


The Missing timestamp message is displayed if you have custom object type mappings.

Use the [PutProfileObjectType](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObjectType.html) API to add the following new attributes to your custom object type:
+ `Fields.sourceLastUpdatedTimestamp`
+ `sourceLastUpdatedTimestampFormat`

If the timestamp attribute is not specified, you can continue to create consolidation criteria, however, a default timestamp of when the records were ingested into Customer Profiles is used. It is recommended to add the new attributes before creating your consolidation criteria.

If you have already defined a custom object type and want to update your custom object type, we run a scheduled backfill every week to update your existing profiles with the `Fields.sourceLastUpdatedTimestamp`. To opt in to the scheduled backfill, use the following steps:

1. Update your custom profile object type by using the [PutProfileObjectType](https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_PutProfileObjectType.html) API.

1. After you update your custom profile object type, open an [AWS Support ticket](https://console.aws.amazon.com/support/home).

1. AWS will schedule the backfill on your behalf. The scheduled backfill runs until end of February 2022.

Alternatively, you can delete and then re-create the ingestion/connector you have for your domain that uses the custom object type. All of your data will be re-ingested using your updated object type and `Fields.sourceLastUpdatedTimestamp` will be parsed from it.

## Example: How matching works


### Example for ONE\$1TO\$1ONE


You can choose `ONE_TO_ONE` as the `AttributeMatchingModel`. When choosing `ONE_TO_ONE` the system can only match if the sub-types are exact matches.

**For example**:

You are using the `EmailAddress` and `BusinessEmailAddress` to represent the `EmailAddress` types. The `AttributeMatchingModel` is `ONE_TO_ONE`.

**Your matching rule is**:

```
Rule Level 1: EmailAddress, LastName, FirstName
Rule Level 2: AccountNumber
```

```
Profile A:
EmailAddress: 1@email.com
BusinessEmailAddress: john@company.com
LastName: Doe
FirstName: John
AccountNumber: account1234
```

```
Profile B:
EmailAddress: 2@email.com
BusinessEmailAddress: john@company.com
LastName: Doe
FirstName: John
AccountNumber: account1234
```

The Profile A and Profile B matches at rule level 1 since the `EmailAddress` type, `LastName`, and `FirstName` match.

### Example for MANY\$1TO\$1MANY


You can choose `MANY_TO_MANY` as the `AttributeMatchingModel`. When choosing `MANY_TO_MANY`, the system can match attributes across the sub-types of an attribute type. 

**For example**:

You are using the `EmailAddress` and `BusinessEmailAddress` to represent the `EmailAddress` types. The `AttributeMatchingModel` is `MANY_TO_MANY`.

**Your matching rule is**:

```
Rule Level 1: EmailAddress, LastName, FirstName
Rule Level 2: AccountNumber
```

```
Profile A:
EmailAddress: 1@email.com  (match with Profile B’s BusinessEmailAddress)
BusinessEmailAddress: john@company.com
LastName: Doe
FirstName: John
AccountNumber: account1234
```

```
Profile B:
EmailAddress: 2@email.com
BusinessEmailAddress: 1@email.com (match with Profile A's EmailAddress)
LastName: Doe
FirstName: John
AccountNumber: account1234
```

The Profile A and Profile B matches at rule level 1 since the `EmailAddress` type, `LastName`, and `FirstName` match.

# View Identity Resolution metrics in Amazon Connect Customer Profiles
Identity Resolution metrics

Whenever Identity Resolution matches or merges profiles, metrics about the process are displayed on the Customer Profiles dashboard. You can review metric for the pass week on the **Identity Resolution** summary page.

The following metrics are generated each time the Identity Resolution Job runs:
+ **Match groups found**: The number of match groups that were found.
  + Available for both ML-based and rule-based Identity Resolution.
+ **Profiles Merged**: The number of profiles that were merged.
  + Available for both ML-based and rule-based Identity Resolution.
+ **Match Group by rule**: The number of match group that were created by each rule level.
  + Only available for rule-based Identity Resolution.

![\[The Amazon Connect Customer Profiles page, the Enable Identity Resolution button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/ir-metrics-example-1.png)


![\[The Amazon Connect Customer Profiles page, the Enable Identity Resolution button.\]](http://docs.aws.amazon.com/connect/latest/adminguide/images/customer-profiles-enable-ir.png)


# Disable Identity Resolution in Amazon Connect Customer Profiles
Disable Identity Resolution

## Disable machine learning-based


You can disable machine learning-based matching when you no longer want it to automatically find similar profiles. If you have consolidation criteria, all your criteria will be deleted and your profiles will no longer be automatically consolidated. Profiles that have already been consolidated will remain consolidated.

## Disable rule-based matching


You can disable rule-based matching when you no longer want it to automatically find similar profiles. If you have a custom matching rule, the matching rule will be deleted and your profiles will no longer be automatically consolidated. Profiles that have already been consolidated will remain consolidated.