---
title: "Examples of identity rules using personal data"
slug: "examples-of-identity-rules-using-personal-data"
abstract: "Provides examples of identity rules and IDENTITY events that use personal data in Sitecore Personalize."
---
# Examples of identity rules using personal data

This topic includes examples of *identity rules* and `IDENTITY` events that use personal data to perform identity resolution.

As an alternative to using personal data, your organization can [use unique identifiers to perform identity resolution](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/identifying-guests-in-sitecore-personalize/understanding-identity-resolution-in-sitecore-personalize/examples-of-identity-rules-using-unique-identifiers.html "Examples of identity rules using unique identifiers"). We recommend your organization uses this approach regardless of whether you pass Personally Identifiable Information (PII) to Sitecore Personalize.

You can [view a tenant's identity rules](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/identifying-guests-in-sitecore-personalize/understanding-identity-resolution-in-sitecore-personalize/view-your-organization-s-identity-rules.html "View your organization's identity rules") in system settings.

We recommend that you [familiarize yourself with identity resolution](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/identifying-guests-in-sitecore-personalize/understanding-identity-resolution-in-sitecore-personalize.html "Understanding identity resolution in Sitecore Personalize") before you review the examples.

<details>
<summary><h2>Identity rule using one guest attribute</h2></summary>

Your organization can configure an identity rule to require a single guest attribute to identify a guest as a **customer**. For example, a guest's email address.

The identity rule for this configuration looks similar to the following image:

![Identity rule using one guest attribute](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/cdp_emailIdentity.png)

Using this same example, your organization can send an `IDENTITY` event that contains the following:

- The `email` attribute with `john.doe@gmail.com` as the string value.

If the string value for the `email` attribute is the same as an existing guest, Sitecore Personalize does the following:

- Migrates the guest's browsing data to the existing guest and retires the other guest.

If the string value for the `email` 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 it contains the required `email` attribute of `john.doe@gmail.com`.

```csharp
{
    "channel": "WEB",
    "type": "IDENTITY",
    "language": "EN",
    "currency": "EUR",
    "page": "home page",
    "pos": "myretailsite.com",
    "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b",
    "email": "john.doe@gmail.com",
    "title": "Mr",
    "firstname": "John",
    "lastname": "Doe",
    "gender": "male",
    "dob": "1980-01-23T00:00",
    "mobile": "+3531234567",
    "phone": "+353123456",
    "street": ["Ashford House", "Tara Street", "Dublin 2"],
    "city": "Dublin",
    "country": "IE",
    "postal_code": "D2"
}

```

When Sitecore Personalize receives the `IDENTITY` event, it evaluates the identity rule as follows:

1. Sitecore Personalize locates the `email` attribute and evaluates the `id` attribute for the identity rule, `email`. It searches the platform to find a guest with an identical string value, `"john.doe@gmail.com"` for the `email` attribute. If it finds the identical string value for the `email` attribute, it migrates the guest data including current session data to the guest with the **customer** guest type.
2. The string value for the `email` attribute is retained to use for identity resolution in the future, along with personalization.

    Sitecore Personalize retires the guest with the **visitor** guest type.

3. If Sitecore Personalize does not find a guest with an identical string value, `"johndoe@gmail.com`", for the `email` attribute, it creates a guest with a **visitor** guest type.

    If a string value for the `email` attribute is not provided, Sitecore Personalize creates a new guest with the **visitor** guest type.

</details>

<details>
<summary><h2>Identity rule requiring multiple guest attributes</h2></summary>

Your organization can have identity rules that require several guest attributes to identify a guest as a **customer**. For example, the guest's first name, last name, and email address.

The identity rules for this configuration look similar to the following image:

![Identity rules using multiple guest attributes](https://doc.sitecore.com/api/markdown-image/personalize/en/users/sitecore-personalize/images/cdp_identityrulesname.png)

Using this same example, your organization must send an `IDENTITY` event that contains values for the `email`, `firstname`, and `lastname` attributes, for Sitecore Personalize to identify a guest. The `IDENTITY` event in the following image meets the required identity rules because it contains string values for the `email`, `firstname`, and `lastname` attributes:

```csharp
{
    "channel": "WEB",
    "type": "IDENTITY",
    "language": "EN",
    "currency": "EUR",
    "page": "home page",
    "pos": "myretailsite.com",
    "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b",
    "email": "john.doe@gmail.com",
    "title": "Mr",
    "firstname": "John",
    "lastname": "Doe",
    "gender": "male",
    "dob": "1980-01-23T00:00",
    "mobile": "+3531234567",
    "phone": "+353123456",
    "street": ["Ashford House", "Tara Street", "Dublin 2"],
    "city": "Dublin",
    "country": "IE",
    "postal_code": "D2"
}

```

When Sitecore Personalize receives the `IDENTITY` event, it evaluates the identity rule as follows:

1. Sitecore Personalize searches the platform to find a guest with identical string values for all of the following attributes:
    - "firstname": "John"
    - "lastname": "Doe"
    - "email": "john.doe@gmail.com"

    If it finds identical string values for all attributes, it migrates the guest data including current session data to the guest with the **customer** guest type.

2. The string values for the `firstname`, `lastname`, and `email` attributes are retained, to use for identity resolution in the future, along with personalization.
3. If Sitecore Personalize does not find a guest with identical string values for the `email`, `firstname`, and `lastname` attributes, it creates a guest with a **visitor** guest type.

    If the value for any one of the `email`, `firstname`, or `lastname` attributes is null, Sitecore Personalize creates a new guest with the **visitor** guest type.

</details>