Send additional event data to Sitecore CDP

Abstract

Describes how to send additional data with an event to Sitecore CDP (Data model 2.1).

You can supply additional data with an event by using the ext object.

The following is a list of guidelines for using the events data extension:

  • Only one data extension per event type is supported.

  • The name of the event data extension must be ext.

  • The key of the event data extensions must be default.

  • The attribute name must be alphanumeric [A-Z,a-z,0-9] as per the json rfc7159 spec.

  • The attribute name of the event data extension must be written in camelCase.

  • The attribute name must be unique within the entire event type.

  • The attribute name of the event data extension must be meaningful. Consider using the friendlyID.

  • If grouping is required, use common prefixes.

  • An event data extension has a maximum of 50 attributes.

The following tables contains the required query parameters:

Attribute

Description

ext

JSON Objects - an object of event extension data.

ext.attribute

One or many name/value pair attributes for custom data. The name must follow the attribute naming guidelines specified. The following are supported Types for the “value”:

  • string: "Hello"

  • Boolean: true or false

  • integer: 9

  • number: 99.9

The following JSON example includes the ext JSON object that enables you to extend events:

{
  "type": "VIEW",
  "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b",
  "channel": "WEB",
  "pos": "acme.com",
  "language": "EN",
  "currency": "EUR",
  "page": "home page",
  "ext": {
    "tileRef": 17
  }
}

Warning

You must not use the same attribute name with different attribute types, when sending a specific event type (VIEW, IDENTITY, and so on). For example, if you send a VIEW event, ensure that the type you use for the attribute value within the ext object is consistent across all VIEW events.

The following JSON examples show a conflict when sending the VIEW event. The conflict is a result of using the status attribute name with an integer type (as shown in ext conflict 1) and using the status attribute name again, but with a string type (as shown in ext conflict 2).

ext conflict 1:

{
   "type":"VIEW",
   "ext":{
      "status":0
   }
}

ext conflict 2:

{
   "type":"VIEW",
   "ext":{
      "status":"OK"
   }
}