Send a custom event to Sitecore CDP

Abstract

Provides the required attributes and a JSON example of how to send a custom event to the Sitecore CDP (Data model 2.0).

After you have tagged your site, you can send standard and custom events to the Event API. 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 this is not known as a standard event in Sitecore CDP. To do this, you can send a custom event called ADD_TO_LIST.

To support these business scenarios, you can send a custom event. You can track how often a custom event is raised by creating a custom goal for an experiment. You can also use the raising of the custom event as the basis for declaring a winner in your experiment.

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

Description

Type

Example(s)

Required/optional

channel

The channel captured on each page the guest visited.

string

"WEB", "MOBILE_WEB", "MOBILE_APP"

Required

type

The name of the custom event.

string (uppercase)

"ADD_TO_LIST"

Required

pos

The point of sale (storefront) captured on each page the guest visited.

string (predefined by client)

"spinflight.com", "spinair.com"

Required

browser_id

The ID of a browser generated by Sitecore CDP.

string (UUID)

"56860bff-94ba-4d84-aa37-2b5a83d5411b"

Required

The following JSON example demonstrates how to send a custom event:

{
    "channel": "WEB",
    "type": "ADD_TO_LIST",
    "pos": "myretail.com",
    "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b"
}

Reserved event names

The following is a list of reserved event names for Sitecore CDP standard events. You must not use any of the following event names for sending custom events:

  • ADD

  • ADD_CONSUMERS

  • ADD_CONTACTS

  • ADD_PRODUCT

  • CALCULATOR

  • CAMPAIGN_TRACKING

  • CLICK

  • CHAT

  • COMMENT

  • CONFIRM

  • CONTACT_REQUEST

  • CONSUMERS

  • EMAIL

  • IDENTITY

  • LOGIN

  • NOTIFICATION

  • ORDER_UPDATE

  • PAYMENT

  • PURCHASE

  • PNR_RECORD

  • SMS

  • SUBSCRIPTION

  • SEARCH

  • SELECT

  • TRIGGER

  • TRIP_SUMMARY

  • UPDATE

  • VIEW