Configuration
A Configuration object holds global constant values related to the current configuration of Kameleoon on this site. Properties| Name | Type | Description |
|---|---|---|
| siteCode | String | The unique site code corresponding to the Kameleoon application file installed on the website. It’s a string of 10 random characters (lower case letters and numerals). |
| singlePageSupport | Boolean | Set to true if you configure Single Page Support. You can configure it globally in the Kameleoon app or with Kameleoon.API.Core.enableSinglePageSupport(). Single Page Support ensures URL changes trigger Kameleoon.API.Core.load() without requiring a browser page reload. |
| goals | Array | List of Goal objects representing all the active (configured) goals for this site. |
| generationTime | Number | Time of the last generation of the Kameleoon application file (UTC format - ms since January 1, 1970). |
Visitor
A Visitor object contains visitor-scoped data independent of specific visits. This object includes a list of all Visit objects for the visitor. Properties| Name | Type | Description |
|---|---|---|
| code | String | The randomly generated visitor code. Unless a custom value has been specifically set on the server (via a Kameleoon server-side SDK), it is a string of 16 random characters (lower case letters and numerals). |
| numberOfVisits | Number | Total visits for the visitor. This value may exceed visits.length, as the Activation API retains only the 25 most recent visits. |
| firstVisitStartDate | Number | Start date (UNIX milliseconds) for the first visit. This value may not align with visits[0].startDate, as the Activation API retains only the 25 most recent visits. |
| visits | Array | List of all the Visit objects made by this visitor on your website, with a maximum of 25 visits. If this visitor made more than 25 visits, only the 25 most recent are available via this property. |
| currentVisit | Object | Visit object corresponding to the current, in-progress visit. The property references the same object as Kameleoon.API.CurrentVisit. |
| previousVisit | Object | Visit object corresponding to the previous visit. If there was no previous visit (that is, the current visit is the first one), this property is null. |
| customData | Object | Map of all custom data with a VISITOR scope. The keys of the map are the defined custom data names. This map only includes custom data that you defined in the Kameleoon app with a VISITOR scope. You can access other custom data from a Visit object. |
| experimentLegalConsent | Boolean | When true, the engine obtained legal consent (or it isn’t required) for the visitor to activate experiments. This property is null if the visitor hasn’t given or declined consent. |
| personalizationLegalConsent | Boolean | When true, the engine obtained legal consent (or it isn’t required) for the visitor to activate personalizations. This property is null if the visitor hasn’t given or declined consent. |
Visit
A Visit object represents a single visit and contains real-time information that Kameleoon gathers. Data points include visit context (device, location), observed behavior (duration, page views), and Kameleoon operations (triggered experiments and personalizations). Properties| Name | Type | Description |
|---|---|---|
| index | Number | Index of the visit. The first visit of a given visitor has an index of 0. Because the Activation API retains only the 25 most recent visits, Kameleoon.API.Visitor.visits[0].index might not equal 0. |
| startDate | Number | Date (UTC format - ms since January 1, 1970) of the start of the visit. |
| duration | Number | Duration of this visit in ms. If this visit is the current visit, this value is always up to date (the engine recomputes it each time you read it). |
| pageViews | Number | Number of pages viewed during the visit. In SPAs, calling Kameleoon.API.Core.load() increments this number. URL changes automatically trigger this call if you enable Single Page Support. |
| locale | String | The locale of the visitor’s browser. |
| device | Object | Device object corresponding to the visitor’s device for this visit. |
| geolocation | Object | Geolocation object corresponding to the visitor’s location for this visit. |
| weather | Object | Weather object corresponding to the visitor’s weather for this visit. |
| activatedExperiments | Array | List of ExperimentActivation objects, corresponding to all the experiments that the engine activated on this visit. |
| activatedPersonalizations | Array | List of PersonalizationActivation objects, corresponding to all the personalizations that the engine activated on this visit. |
| conversions | Object | Map of conversions performed on this visit. The keys of the map are the defined goal IDs. The values are Objects with two keys: count (number of times the visit converted this goal) and revenue (total revenue of this goal for this visit). |
| customData | Object | Map of all custom data with a PAGE or VISIT scope. The keys of the map are the defined custom data names. This map only includes custom data that you defined in the Kameleoon app with a PAGE or VISIT scope. You can access other custom data from the Visitor object. |
| currentProduct | Object | Product object corresponding to the product displayed on the current product page. If the visitor isn’t on a product page, this property is null. |
| products | Array | List of Product objects, corresponding to all the product pages that the visit viewed (including the currentProduct if applicable). |
| acquisitionChannel | String | Name of the acquisition channel for the visit. You define the list of acquisition channels, along with their characteristics (mainly how Kameleoon can infer them, for instance by URL parameter), in the Kameleoon app. |
| landingPageURL | String | URL of the first page of the visit, usually called the landing page. |
| initialConversionPredictions | Object | Map of Kameleoon Conversion Scores (KCS). The keys of the map are the defined key moment names. The values range from 0 to 100, representing the KCS for the designated key moment. (Note: Kameleoon recently changed “key moment” to “triggers” in the Kameleoon app.) |
The
kameleoonConversionScores property is only available with the Contextual Bandit & AI Targeting Premium add-on.Device
A Device object contains data about the device for a given visit. Properties| Name | Type | Description |
|---|---|---|
| browser | String | Name of the browser. Possible values are: Chrome, Chromium, Firefox, Safari, Microsoft Edge, Internet Explorer, Opera, Android, iPhone, iPad, iPod, Samsung Internet for Android, Opera Coast, Yandex Browser, UC Browser, Maxthon, Epiphany, Puffin, Sleipnir, K-Meleon, Windows Phone, Vivaldi, Sailfish, SeaMonkey, Amazon Silk, PhantomJS, SlimerJS, BlackBerry, WebOS, Bada, Tizen, QupZilla, Googlebot, Blink, Gecko, Webkit. |
| browserVersion | String | Version of the browser. |
| os | String | Name of the OS. Possible values are: Windows, Mac, Linux, Android, iOS, Chrome OS, Windows Phone. |
| type | String | Type of the device. Possible values are: Desktop, Tablet, Phone. |
| screenHeight | Number | Height of the device’s screen (in pixels). |
| screenWidth | String | Width of the device’s screen (in pixels). |
| windowHeight | Number | Height of the browser’s window (in pixels). |
| windowWidth | String | Width of the browser’s window (in pixels). |
| adBlocker | Boolean | Boolean equal to true if this device has an active ad blocker, else to false. |
| timeZone | String | Time zone of the browser. The value is a string (for example, “Europe/Paris”) that corresponds to the TZ database of time zones. |
Geolocation
A Geolocation object contains data about the physical location of the visitor for a given visit. Properties| Name | Type | Description |
|---|---|---|
| country | String | Country name, in English. |
| region | String | Name of the region, in the country’s preferred language. |
| city | String | Name of the city, in the country’s preferred language. |
| postalCode | String | Postal code. |
| latitude | Number | Latitude (in degrees). |
| longitude | Number | Longitude (in degrees). |
Weather
A Weather object contains data about the weather conditions occurring at the time of the visit. Properties| Name | Type | Description |
|---|---|---|
| temperature | String | Temperature in Kelvin. |
| humidity | String | Humidity in percentage (from 0 to 100). |
| pressure | String | Atmospheric pressure in hPa. |
| windSpeed | String | Wind speed in meters/sec. |
| cloudiness | Number | Cloudiness in percentage (from 0 to 100). |
| sunrise | Number | Time of sunrise (UTC format - ms since January 1, 1970). |
| sunset | Number | Time of sunset (UTC format - ms since January 1, 1970). |
| conditionCode | Number | Weather condition ID code. Full reference list is available here. |
| conditionDescription | String | Weather condition description that matches the conditionCode. For example, a conditionCode of 800 has a conditionDescription of clear sky. |