---
title: "EngageServer.personalize(personalizationData, callback[, timeout])"
slug: "engageserver-personalize"
abstract: "Describes the server-side personalize() function in the Sitecore Engage SDK (Sitecore Personalize Stream API)."
---
# EngageServer.personalize(personalizationData, callback\[, timeout\])

> [!note]
> This is a server-side function used for implementing [server-side tracking](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/server-side-tracking-with-the-engage-sdk-package.html "Server-side tracking with the Engage SDK package"). If you want to implement client-side tracking instead, use the [client-side functions](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/sending-events-using-the-engage-sdk.html "Sending events using the Engage SDK").

The `personalize()` function runs an interactive full stack experience or an interactive full stack experiment that's currently live in Sitecore Personalize. You must call this function with the `friendlyId` of the live experience or experiment that you want to run.

> [!note]
> Call this function to run a live Interactive full stack experience or a live Interactive full stack experiment only.
>
> Web experiences and web experiments are run by the Engage SDK automatically.

You can find the `friendlyId` in Sitecore Personalize, in a live interactive full stack experience or experiment, by clicking **Summary**. The `friendlyId` is in **Details** > **Friendly ID**.

sidebar. Parameters

| Parameter | Type | Description | Note |
| --- | --- | --- | --- |
| [`personalizationData`](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/personalization-data-object.html) | object | Event and experiment data. | Specify the `friendlyId` in this object. |
| `callback` | function | This callback function handles the response. | N/A |
| `[timeout]`<br><br>optional | integer<br><br>Minimum `0` | The number of milliseconds before the function times out and returns an error.<br><br>When you use `timeout`, use try-catch blocks to handle errors. | For example, set the value to `200` for the function to time out in 0.2 seconds. |

Here's an example of how to run an experience or experiment and log it to the console.

```javascript
export async function middleware(req) {
  const res = NextResponse.next();

  // Load Engage API
  const engageSettings = {
    clientKey: "<client_key_PLACEHOLDER>",
    targetURL: "<stream_api_target_endpoint_PLACEHOLDER>",
    pointOfSale: "<point_of_sale_PLACEHOLDER>"
  };

  // Personalization data
  const personalizationData = {
    channel: "WEB",
    currency: "EUR",
    friendlyId: "running_shoes_popup_02",
    // optional attributes:
    params: { key: "value" }
}

  const engageServer = await initServer(engageSettings);

  await engageServer.personalize(personalizationData, (res) => {console.log(res)}, 4000);
  return res;
};

```