Send an event as an HTTP GET request
Provides an example of how to send an event as an HTTP GET
request to Sitecore CDP (Data model 2.1).
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 |
---|---|---|
| string | The organization's unique identifier. |
| 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 |
---|---|---|---|---|
| The channel captured on each page the guest visited. | string |
| Required |
| The type of event. | string (uppercase) |
| Required |
| The language captured on each page the guest visited. | string (2 letter ISO 639 language code) |
| Required |
| The type of currency. | string (3 letter ISO 4217) |
| Required |
| The name of the webpage the guest visited. | string |
| Required |
| The point of sale (storefront) captured on each page the guest visited. | string (predefined by client) |
| Required |
| The ID of a browser generated by Sitecore CDP. | string (UUID) | " | Required |
For any subsequent events that you send with the same channel
, pos
, 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" }