Skip to main content
POST
Send visitor events

Headers

user-agent
string
default:kameleoon-docs
required

Not always required. 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.

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:



List of parameters for the eventType STATICDATA:


List of parameters for the eventType PAGE:


List of parameters for the eventType CONVERSION:


List of parameters for the eventType TARGETINGSEGMENT:


List of parameters for the eventType EXPERIMENT:


List of parameters for the eventType PERSONALIZATION:


List of parameters for the eventType WEATHER:


List of parameters for the eventType CUSTOMDATA:


List of parameters for the eventType PRODUCT:


List of parameters for the eventType GEOLOCATION:


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:

Body example if the URL query parameter json is true (pretty representation):

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.