Context

As implied by its name the context is supposed to provide contextual information about an event. This will help to classify and interpret KPIs generated from the events. Put differently the context describes the user journey from the inside out. This can range from the specifics of single elements in a product set to global information such as the containing page or even enduser navigating the pages. Some of this contextual data will be attached at the API level. Other information has to be supplied from the client-side.

{
  ...,
  "context": [
    {
      "content": {
        "setCompose": {
          "id": "1b3de0bd-95c6-435a-8bb9-f4cae0160388",
        },
        "type": "setCompose"
      },
      "type": "content",
    }
  ]
}

Similarly to the event structure itself, context elements will always have a type and optionally a type-specific payload named thereafter.

Currently, only two context types are supported: content and user.

user

If you want to have user-based metrics, you must provide a user context.

The user context is responsible for the event attribution:

{ 
  "type": "user",
  "user": {
    "id": "<user-id>"
  }
}

Read the section about user identification for more information on user-based metrics and the requirements for the anonymized user ID.

content

If the tracked interaction takes place within the context of some 8SELECT-provided content, e.g. a click on one of the products in an 8.SET Compose product set, the following information must be included in the context of this event:

{
  "content": {
    "setCompose": {
      "id": "<set-id>",
    },
    "type": "setCompose"
  },
  "type": "content",
}

Currently, only content of type setCompose is supported.

Last updated