---
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 CDP 2.0 data model (Sitecore CDP)."
---
# 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/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/identifying-guests-in-sitecore-cdp/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 CDP.

Only organizations still using [Sitecore CDP 2.0 data model](https://doc.sitecore.com/cdp/en/developers/api/index-en.html?contextId=6z38AW) can use personal data to perform identity resolution.

You can [view a tenant's identity rules](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/identifying-guests-in-sitecore-cdp/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/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/identifying-guests-in-sitecore-cdp/understanding-identity-resolution-in-sitecore-cdp.html "Understanding identity resolution in Sitecore CDP") 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/cdp/en/users/sitecore-cdp/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 profile, Sitecore CDP does the following:

- Migrates the guest's browsing data to the guest's existing guest profile, while retiring the other guest profile.

If the string value for the `email` attribute is not the same as an existing guest profile, Sitecore CDP creates a new guest profile 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 CDP receives the `IDENTITY` event, it evaluates the identity rule as follows:

1. Sitecore CDP locates the `email` attribute and evaluates the `id` attribute for the identity rule, `email`. It searches the platform to find a guest profile 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 profile with the **customer** guest type.
2. The string value for the `email` attribute is retained in the guest profile, to use for identity resolution in the future, along with personalization. You can [use debug mode](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/use-debug-mode-in-sitecore-cdp.html "Use debug mode in Sitecore CDP") to [view the guest profile](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/view-a-guest-profile-in-sitecore-cdp.html "View a guest profile in Sitecore CDP") in JSON format.

    Sitecore CDP retires the guest profile with the **visitor** guest type.

    The following image displays a guest profile with the populated `email` attribute:

    ![Email attribute in the guest profile](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/cdp_profile_PII.png)

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

    If a string value for the `email` attribute is not provided, Sitecore CDP creates a new guest profile 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/cdp/en/users/sitecore-cdp/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 CDP 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 CDP receives the `IDENTITY` event, it evaluates the identity rule as follows:

1. Sitecore CDP searches the platform to find a guest profile 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 profile with the **customer** guest type.

2. The string values for the `firstname`, `lastname`, and `email` attributes are retained in the guest profile, to use for identity resolution in the future, along with personalization. You can [use debug mode](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/use-debug-mode-in-sitecore-cdp.html "Use debug mode in Sitecore CDP") to [view the guest profile](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/managing-guests-in-sitecore-cdp/view-a-guest-profile-in-sitecore-cdp.html "View a guest profile in Sitecore CDP") in JSON format.

    Sitecore CDP retires the guest profile with the **visitor** guest type.

    The following image displays a guest profile with the populated `email` attribute:

    ![firstname, lastname, and email attributes in the guest profile](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/cdp_profile_PII.png)

3. If Sitecore CDP does not find a guest with identical string values for the `email`, `firstname`, and `lastname` attributes, it creates a guest profile with a **visitor** guest type.

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

</details>