Examples of identity rules using unique identifiers
This topic includes examples of identity rules and IDENTITY
events that use unique identifiers to perform identity resolution.
The examples in this topic are relevant to both the Sitecore Personalize 2.0 data model and the 2.1 data model.. If you are unsure of the data model your organization uses, ask your Sitecore representative.
You can verify a tenant's identity rules in system settings.
Organizations can use the identifiers
array of JSON objects to identify guests in Sitecore Personalize. An identifier is a unique string used to identify the guest, such as a unique ID from a Customer Relationship Management (CRM) system or loyalty program. Identifiers are not created by Sitecore Personalize, they are created by your organization and sent to Sitecore Personalize.
We recommend that you familiarize yourself with identity resolution before you review the examples.
Single identity rule
Your organization can configure a single identity rule that uses a unique identifier to identify a guest as a customer.
For example, your organization can use one identity rule, email address
.
The identity rule for this configuration looks similar to the following image:

Using this same example, your organization can send an IDENTITY
event that contains the id
attribute with an email address as the string value.
If the string value for the id
attribute is the same as an existing guest, Sitecore Personalize migrates the guest's browsing data to the existing guest, while retiring the other guest.
If the string value for the id
attribute is not the same as an existing guest, Sitecore Personalize. creates a new guest with visitor as the guest type.
The following IDENTITY
event meets the required identity rule because the identifiers
array of JSON objects contains a value for the "id"
attribute.
{
"channel":"WEB",
"type":"IDENTITY",
"language":"EN",
"currency":"EUR",
"page":"home page",
"pos":"myretailsite.com",
"browser_id":"56860bff-94ba-4d84-aa37-2b5a83d5411b",
"identifiers":[
{
"provider":"email",
"id":"[email protected]"
}
]
}
When Sitecore Personalize receives the IDENTITY
event, it evaluates the identity rule as follows:
-
Sitecore Personalize locates the
identifiers
array of JSON objects and evaluates the value of theid
attribute,"[email protected]"
. It searches the platform to find a guest with an identical string value of"[email protected]"
for theid
attribute. If it finds the identical string value in theidentifiers
array of JSON objects, it migrates the guest data including current session data to the guest with the customer guest type. Sitecore Personalize adds theidentifiers
object to the guest, to use for identity resolution in the future. It retires the guest with the visitor guest type. -
If Sitecore Personalize does not find a guest with an identical string value,
"[email protected]"
, for theid
attribute, it creates a guest with a visitor guest type.If a string value for the
id
attribute is not provided for theSITECORE_ID
attribute, Sitecore Personalize creates a new guest with the visitor guest type.
Multiple identity rules
Your organization can configure multiple identity rules to use a unique identifier to identify a guest as a customer.
For example, your organization can use two identity rules: CRM_ID
and loyalty_ID
. You can configure Sitecore Personalize to evaluate the identity rules using the equivalent of an OR
operator, so that either identity rule can be used to identify a guest.
The identity rules for this configuration look similar to the following image:

Using this same example, your organization must send an IDENTITY
event that contains a string value for the id
attribute, for either the CRM_ID
or loyalty_ID
attributes, for Sitecore Personalize to identify a guest. The following IDENTITY
event meets the required identity rules because it contains at least one of the required id
attributes:
{
"channel":"WEB",
"type":"IDENTITY",
"language":"EN",
"currency":"EUR",
"page":"home page",
"pos":"myretailsite.com",
"browser_id":"56860bff-94ba-4d84-aa37-2b5a83d5411b",
"identifiers":[
{
"provider":"CRM_ID",
"id":"123456"
},
{
"provider":"loyalty_ID",
"id":"xni8934y77"
}
]
}
When Sitecore Personalize receives the IDENTITY
event, it evaluates the identity rules in the order they are listed on the Identity Rules screen, as follows:
-
Sitecore Personalize locates the
identifiers
array of JSON objects and evaluates theid
attribute for the first identity rule, CRM number. It searches the platform to find a guest with an identical string value,"123456"
for theid
attribute. If it finds the identical string value in theidentifiers
array of JSON objects, it migrates the guest data including current session data to the guest with the customer guest type. It retires the guest with the visitor guest type. -
If Sitecore Personalize does not find a guest with an identical string value for the
id
attribute for the first identity rule, CRM number, it evaluates theid
attribute for the next identity rule, Loyalty number. The following occurs:-
If Sitecore Personalize does not find a guest with an identical string value,
"xni8934y77
", for theid
attribute for the second identity rule, Loyalty number, it creates a guest with a visitor guest type. -
If Sitecore Personalize finds a guest with an identical string value,
"xni8934y77
", for theid
attribute for the second identity rule, Loyalty number, it migrates the guest data including current session data to the existing guest with the customer guest type. It retires the guest with the visitor guest type.
Sitecore Personalize adds the
identifiers
object to the guest, to use for identity resolution in the future.If a string value for the
id
attribute is not provided for either theCRM_ID
attribute orloyalty_ID
attribute, Sitecore Personalize creates a new guest with the visitor guest type. -