Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
PersonalizeCloud Portal
Sitecore Personalize developer documentation
  • Developing with Sitecore Personalize
            • Engage.init(settings)
            • Engage.initServer(settings)
            • Engage.initServer.handleCookie(req, res)
            • Engage.getBrowserId()
            • Engage.getGuestId()
            • Engage.updatePointOfSale(pointOfSale)
            • Engage.pageView(eventData[, extensionData])
            • Engage.identity(eventData[, extensionData])
            • Engage.event(type, eventData[, extensionData])
            • Engage.addToEventQueue(type, eventData[, extensionData])
            • Engage.processEventQueue()
            • Engage.clearEventQueue()
            • Engage.personalize(personalizationData[, timeout])
            • EngageServer.pageView(eventData, req[, extensionData])
            • EngageServer.identity(eventData, req[, extensionData])
            • EngageServer.event(type, eventData, req[, extensionData])
            • EngageServer.personalize(personalizationData, callback[, timeout])
            • window.Engage.triggerExperiences()
        • Troubleshooting
        • Release notes
  1. Functions
  1. Stream API
  2. Functions
  3. Engage.identity(eventData[, extensionData])

Engage.identity(eventData[, extensionData])

The identity() function sends an IDENTITY event. The IDENTITY event is used to resolve the identity of an anonymous user of your app and turn them into a known user.

sidebar. Parameters

Parameter

Type

Description

eventData

object

All the event data.

[extensionData]

optional

object

Custom data about an event.

Maximum 50 custom attributes of your choice.

Here's an example of how to use the identity() function to send the email address that a user enters in a form. In a React app, you can capture form data using the State Hook.

components/Form.jsx:

import { useState } from "react";
import { engage } from "../engage";

export default function Form() {
    const [email, setEmail] = useState("");

    const handleEmail = (e) => {
        setEmail(e.target.value);
    };

    const handleSubmit = async (e) => {
        e.preventDefault();

        const eventData = {
          channel: "WEB",
          currency: "EUR",
          pointOfSale: "myretailsite/ireland",
          language: "EN",
          page: "home",
          email,
          identifiers: [
              {
                  id: "123456",
                  provider: "BXLP"
              }
          ]
        };

        const extensionData = {
          customKey: "customValue"
        };
        
        // Send IDENTITY event to Sitecore Personalize
        await engage.identity(eventData, extensionData);
    };

    return (
        <form onSubmit={handleSubmit}>
            <label>
                <span>Email:</span>
                <input type="text" onChange={handleEmail} value={email} />
            </label>

            <button>Subscribe</button>
        </form>
    )
};
If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use