Skip to main content
POST
/
visit
/
events
Send visitor events
curl --request POST \
  --url https://eu-data.kameleoon.io/visit/events \
  --header 'Content-Type: */*' \
  --data '"<string>"'

Documentation Index

Fetch the complete documentation index at: https://docs.kameleoon.com/llms.txt

Use this file to discover all available pages before exploring further.

Query Parameters

siteCode
string
required

The Kameleoon project ID.

visitorCode
string

The visitor code (a unique Kameleoon ID for a visitor). Note: If you provide the visitorCode parameter here, it is assumed to be the common value for all events in the body. If you want to post several events for different visitors, provide the visitorCode with every event in the body.

json
boolean
default:false

Set to true to provide the body content in JSON format; otherwise, URL query format is assumed. See the body schema for details.

Body

*/*

Save events. The body size limit is 3 MB.

If the json query parameter is missing or set to false, the body consists of one or more lines. Each line represents an event in the following format: <parameter 1 name>=<parameter 1 value>&<parameter 2 name>=<parameter 2 value> and so on. Escape values that may contain characters = or &, for example, using the encodeURIComponent JavaScript function.

If the json query parameter is set to true, provide the body as a JSON array of events. Represent each event as a JSON object, formatted like this: { "<parameter 1 name>": <parameter 1 value>, "<parameter 2 name>": <parameter 2 value>, etc. }.

In all cases, the body contains the following parameters:

NameTypeRequiredDescription
visitorCodestringRequired if you don't provide it in URL query parameters. Otherwise, Kameleoon ignores it.Unique Kameleoon visitor ID.
Limit to 100 characters
noncestringRequiredA random string of 16 hexadecimal characters, unique to each event.
eventTypestringRequiredOne of the following: STATICDATA, PAGE, CONVERSION, TARGETINGSEGMENT, EXPERIMENT, PERSONALIZATION, WEATHER, CUSTOMDATA, PRODUCT, GEOLOCATION


List of parameters for the eventType STATICDATA:
NameTypeRequiredDescription
visitNumberint32OptionalNumber of visits
timeSincePreviousVisitint64OptionalTime since last visit in milliseconds
browserstringOptionalBrowser's name (for example, "Safari").
Limit to 100 characters
browserIndexint32OptionalConfigured browser index
browserVersionfloat64OptionalBrowser version
osstringOptionalOS name (for example, "Windows").
Limit to 100 characters
osIndexint32OptionalConfigured OS index
screenWidthint32OptionalScreen width
screenHeightint32OptionalScreen height
localeLanguageTagstringOptionalLocal language tag (for example, "fr").
deviceTypestringOptionalOne of the following: DESKTOP, TABLET, PHONE


List of parameters for the eventType PAGE:
NameTypeRequiredDescription
herfstringRequiredComplete URL
Limit to 2048 characters
canonicalHrefstringOptionalCanonical URL
Limit to 2048 characters
titlestringOptionalPage title
Limit to 256 characters
keyPageIndicesJSON arrayOptionalA JSON array of configured key page indices.
referrerHrefstringOptionalComplete URL of the referrer.
referrerIndicesJSON arrayOptionalA JSON array of configured referrer indices.


List of parameters for the eventType CONVERSION:
NameTypeRequiredDescription
goalIdint64RequiredGoal ID
revenuefloat64OptionalRevenue generated in the goal
negativeBooleanOptional,
default false
Remove the conversion?
metadataJSON objectOptionalMetadata details.


Note: In these examples, Kameleoon assumes you provide the visitorCode parameter in the URL query part.

Body example if the URL query parameter json is missing or its value is false:
nonce=d2ce4d22083348fb&eventType=STATICDATA&browser=Safari&browserVersion=16.3&deviceType=DESKTOP&os=Windows
nonce=b0a4253d8acd01c7&eventType=PAGE&href=https%3A%2F%2Fwww.supersite.com%2Fsuperpage%3Fsuperparam%3Dtrue
nonce=4ca34741a6cc8a48&eventType=CONVERSION&goalId=2&revenue=24.99

Body example if the URL query parameter json is true (pretty representation):
[
{
"nonce": "d2ce4d22083348fb",
"eventType": "STATICDATA",
"browser": "Safari",
"browserVersion": 16.3,
"deviceType": "DESKTOP",
"os": "Windows"
},
{
"nonce": "b0a4253d8acd01c7",
"eventType": "PAGE",
"href": "https://www.supersite.com/superpage?superparam=true"
}
]

The body is of type string<UTF-8>.

Response

Kameleoon processed the URL query and accepted the request. The response returns no content.
Kameleoon processes the body asynchronously and has not checked the body syntax yet.