curl --request POST \
--url https://eu-data.kameleoon.io/visit/events \
--header 'Content-Type: */*' \
--data '"<string>"'Post conversion and page view events for a visitor.
Kameleoon rejects an incoming request if the source is a bot or spider, based on IAB/ABC user-agent filtering rules.
Kameleoon uses a single-pass method. You don’t need to take specific action when sending requests from a web browser using a standard library (XHR). However, in other cases, set a custom value for the User-Agent request header to overwrite the default value the library sets.
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.
The Kameleoon project ID.
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.
Set to true to provide the body content in JSON format; otherwise, URL query format is assumed. See the body schema for details.
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:
| Name | Type | Required | Description |
|---|---|---|---|
| visitorCode | string | Required if you don't provide it in URL query parameters. Otherwise, Kameleoon ignores it. | Unique Kameleoon visitor ID. Limit to 100 characters |
| nonce | string | Required | A random string of 16 hexadecimal characters, unique to each event. |
| eventType | string | Required | One of the following: STATICDATA, PAGE, CONVERSION, TARGETINGSEGMENT, EXPERIMENT, PERSONALIZATION, WEATHER, CUSTOMDATA, PRODUCT, GEOLOCATION |
STATICDATA:| Name | Type | Required | Description |
|---|---|---|---|
| visitNumber | int32 | Optional | Number of visits |
| timeSincePreviousVisit | int64 | Optional | Time since last visit in milliseconds |
| browser | string | Optional | Browser's name (for example, "Safari"). Limit to 100 characters |
| browserIndex | int32 | Optional | Configured browser index |
| browserVersion | float64 | Optional | Browser version |
| os | string | Optional | OS name (for example, "Windows"). Limit to 100 characters |
| osIndex | int32 | Optional | Configured OS index |
| screenWidth | int32 | Optional | Screen width |
| screenHeight | int32 | Optional | Screen height |
| localeLanguageTag | string | Optional | Local language tag (for example, "fr"). |
| deviceType | string | Optional | One of the following: DESKTOP, TABLET, PHONE |
PAGE:| Name | Type | Required | Description |
|---|---|---|---|
| herf | string | Required | Complete URL Limit to 2048 characters |
| canonicalHref | string | Optional | Canonical URL Limit to 2048 characters |
| title | string | Optional | Page title Limit to 256 characters |
| keyPageIndices | JSON array | Optional | A JSON array of configured key page indices. |
| referrerHref | string | Optional | Complete URL of the referrer. |
| referrerIndices | JSON array | Optional | A JSON array of configured referrer indices. |
CONVERSION:| Name | Type | Required | Description |
|---|---|---|---|
| goalId | int64 | Required | Goal ID |
| revenue | float64 | Optional | Revenue generated in the goal |
| negative | Boolean | Optional, default false | Remove the conversion? |
| metadata | JSON object | Optional | Metadata details. |
visitorCode parameter in the URL query part.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.99json 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>.
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.
Was this page helpful?