Send an event as an HTTP GET request

Abstract

Provides an example of how to send an event as an HTTP GET request to Sitecore CDP (Data model 2.0).

The easiest way to send an event from your web application is to send it as an HTTP GET request.

Use the /v1.2/event/create.json?client_key=<CLIENT_KEY>&message=<EVENT_V1> URL to send an event as an HTTP GET request. Use the event HTTP query parameter to carry the event payload.

Required query parameters

To send an event, use the following required query parameters:

Parameter

Type

Description

client_key

string

The organization's unique identifier.

message

string

The message containing the event data.

Required event attributes

You must designate the event type when you send an event. The event type is VIEW in the JSON example.

To send an event, use the following required event 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 type of event.

string (uppercase)

"VIEW"

Required

language

The language captured on each page the guest visited.

string (2 letter ISO 639 language code)

"EN", "FR", "DE"

Required

currency

The type of currency.

string (3 letter ISO 4217)

"EUR", "USD", "GBP"

Required

page

The name of the webpage the guest visited.

string

"home page", "search page" "/home", "/confirm"

Required

pos

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

string (predefined by client)

"retailsite123.com", "myretailesite456.com"

Required

browser_id

The ID of a browser generated by Sitecore CDP.

string (UUID)

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

Required

For any subsequent events that you send with the same channelpos, and browser_id attributes, you only have to include the type attribute.

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

GET /v1.2/event/create.json?client_key=<CLIENT_KEY>&message=
{
    "channel": "WEB",
    "type": "VIEW",
    "language": "EN",
    "currency": "EUR",
    "page": "home page",
    "pos": "retailsite.com",
    "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b"
}
{
   "status":"OK",
   "version":"1.2",
   "client_key":"ghsPMFpfrXBzxKozB0IoL4yyAT0s7WrH",
   "ref":"4888p5d9-6117-4f8d-a182-271c3e917103"
}