---
title: "Custom event"
slug: "custom-event-1166461"
abstract: "Describes the JSON object for a custom event when using direct HTTP requests (Sitecore CDP Stream API)."
---
# Custom event

::::tabs
:::tab{title="2.1"}

A custom event is unique to your organization. For example, most retail sites have an `ADD` event that captures when a guest clicks the add button. However, you might want to capture, for example, how many times a guest adds items to a wish list, and for this, there is no standard event in Sitecore CDP. To do this, you can send a custom event, for example, `ADD_TO_WISHLIST`.

You can track how often a custom event is raised by creating a goal for an experiment in Sitecore Personalize. You can also use the raising of the custom event as the basis for declaring a winner in your experiment.

> [!note]
> **Notice**
> You send a custom event in the same way that you send a standard event. You must be consistent with the name of the custom event you send and you must not use the name of a standard event.

To send a custom event, use the following required attributes:

| Attribute | Type | Description | Example |
| --- | --- | --- | --- |
| `channel` | string (uppercase) | The touchpoint where the user interacts with your brand. | <ul><li>`"MOBILE_APP"`</li><li>`"MOBILE_WEB"`</li><li>`"WEB"`</li></ul> |
| `type` | string (uppercase) | The name of the custom event. This is a custom value of your choice. However, you must not set the value to any of the [Sitecore CDP reserved event names](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/custom-event-1166461.html#UUID-d61ee775-814d-51d9-a38c-df32d9c1927d_para-idm19016690203552312). | You must not set the value to any of the Sitecore CDP reserved event names:<br><br><ul><li>Any event name starting with `"SC_"`</li><li>`"ADD"` - standard [ADD](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add-event.html) event.</li><li>`"ADD_CONSUMERS"` - standard [ADD_CONSUMERS](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add_consumers-event.html) event.</li><li>`"ADD_CONTACTS"` - standard [ADD_CONTACTS](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add_contacts-event.html) event.</li><li>`"CAMPAIGN_TRACKING"` - internally reserved event. Do not use.</li><li>`"CHECKOUT"` - standard [CHECKOUT](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/checkout-event.html) event.</li><li>`"CLEAR_CART"` - standard [CLEAR_CART](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/clear_cart-event.html) event.</li><li>`"CONFIRM"` - standard [CONFIRM](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/confirm-event.html) event.</li><li>`"FEEDBACK"` - FEEDBACK event.</li><li>`"IDENTITY"` - standard [IDENTITY](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/identity-event.html) event.</li><li>`"INTERACTION"` - internally reserved event. Do not use.</li><li>`"ORDER_CHECKOUT"` - standard [ORDER_CHECKOUT](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/order_checkout-event.html) event.</li><li>`"PAYMENT"` - standard [PAYMENT](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/payment-event.html) event.</li><li>`"SUBSCRIPTION"` - internally reserved event. Do not use.</li><li>`"SEARCH"` - standard [SEARCH](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/search-event.html) event.</li><li>`"TRACKING"` - internally reserved event. Do not use.</li><li>`"VIEW"` - standard [VIEW](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/view-event.html) event.</li></ul> |
| `language` | string (uppercase [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)) | The language the user is using your app in. | <ul><li>`"DE"`</li><li>`"EN"`</li><li>`"FR"`</li></ul> |
| `currency` | string (uppercase [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)) | The alphabetic currency code of the currency the user is using in your app. | <ul><li>`"EUR"`</li><li>`"GBP"`</li><li>`"USD"`</li></ul> |
| `page` | string | The name of the webpage where the interaction with your brand takes place.<br><br>This is a custom value of your choice. | <ul><li>`"home"`</li><li>`"contact-us.html"`</li></ul> |
| `pos` | string | [The name of the point of sale](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538) where the interaction with your brand takes place. | <ul><li>`"myretailsite/ireland"`</li><li>`"spinair.com/france"`</li></ul> |
| `browser_id` | string | The [browser ID](https://doc.sitecore.com/cdp/en/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/retrieve-the-browser-id.html). | `"a38b230c-11eb-4cf9-8d5d-274e9f344925​"` |

Example 53. Custom event object

```json
{
    "channel": "MOBILE_APP",
    "type": "ADD_TO_WISHLIST",
    "language": "EN",
    "currency": "EUR",
    "page": "home",
    "pos": "myretailsite/ireland",
    "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​"
}

```

sidebar. Extending a custom event

:::tab{title="2.1"}

Example 54. Custom event object with custom attributes

You can extend a custom event by including a maximum of 50 custom attributes of your choice.

In the `type` attribute of the event, the custom event name is specified as `myretailsite:CLICKED_POPUP`. The event contains the custom attributes `clickedPopup` and `timeBetweenPopupAndClick`.

```json
{
    "channel": "MOBILE_APP",
    "type": "myretailsite:CLICKED_POPUP",
    "language": "EN",
    "currency": "EUR",
    "page": "home page",
    "pos": "myretailsite/ireland",
    "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
    "ext": {
       "clickedPopup": "true",
       "timeBetweenPopupAndClick": "8 seconds"
    }
}

```

:::
:::tab{title="2.1"}

Example 55. Custom event object with custom goal value

This example shows a custom event that is used to track variant performance against a [custom goal](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/en/add-a-custom-goal-to-an-experiment-in-sitecore-personalize.html). In this example, the custom event name is specified in the `type` parameter as `ADD_BAG`. The event contains an `ext` object which includes a custom goal value `bagValue` and attribute `bagConverted`.

If the custom goal is set up to track the numerical price of bag using `bagValue`, each time the custom event triggers, this number will be derived from the `ext` object and considered in goal calculations.

Additionally, if the custom goal is also set up to track an additional attribute such as `bagConverted`, the attribute's string value can be used to determine if the custom event is successful.

```json
{
    "channel": "WEB",
    "type": "ADD_BAG",
    "language": "EN",
    "currency": "EUR",
    "page": "home page",
    "pos": "myeurosite",
    "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925",
    "ext": {
       "bagValue": "1234",
       "bagConverted": "true"
    }
}

```

:::
::::

:::
:::tab{title="2.0"}

2.0 data model does not support this functionality.

:::