REST API (Server-Side API)

Welcome to Kameleoon API! This API will allow you to use every entity of Kameleoon application inside your own application. Find the full list of the supported functionalities on this page.

Rest Auth

Get Token

Create temporary token using username and password from request body. Expiration in 1 hour.

/k-api/authorization
curl -k -X POST \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'username=a@a.com&password=123456qwerty' \
"https://api.kameleoon.com/k-api/authorization" \

Parameter

Field Description
username

Your user name.

password

Your user password.

HTTP/1.1 200 OK
{
     "success": true,
     "errors": [],
     "result": {
         "token": "ABCDEF123456789",
         "expiration_in": 3600
     }
}

Site

Create Site

Create a site with default values.

https://api.kameleeon.com/k-api/site
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
    "name":"site name",
    "url":"https://www.example.com"
}' \
"https://api.kameleoon.com/k-api/site" \

Parameter

Field Type Description
url String

The site url. Must start from http:// or https://.

name optional String

The site name.

HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "site name",
			"id": 2,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "https://www.example.com"
		},
		"success": true,
		"errors": []
}

Get Site

Get the informations of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/site/1" \
HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "a@a.com",
			"id": 1,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "http://www.example.com"
		},
		"success": true,
		"errors": []
}

Get list of sites

Get the list of customer sites.

https://api.kameleeon.com/k-api/site
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/site" \
HTTP/1.1 200 OK
{
		"result": {
			"sites": [
				{
					"includeJQuery": false,
					"name": "a@a.com",
					"id": 1,
					"googleAnalyticsProfile": null,
					"googleAnalyticsMainGoal": "E_COMMERCE",
					"url": "http://www.example.com"
				}
			]
		},
		"success": true,
		"errors": []
}

Update Site

Update the information of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
    "name":"new site name",
    "url":"https://www.new-example.com",
    "includeJQuery":false
}' \
"https://api.kameleoon.com/k-api/site/1" \

Parameter

Field Type Description
name optional String

The site name.

url optional String

The site url. Must start from http://
or https://.

includeJQuery optional Boolean

Set true if you want to include JQuery
on your site.

googleAnalyticsProfile  optional String

Google analytics profile code.

googleAnalyticsMainGoal optional String

Google analytics main goal code.

HTTP/1.1 200 OK
{
		"result": {
			"includeJQuery": false,
			"name": "new site name",
			"id": 1,
			"googleAnalyticsProfile": null,
			"googleAnalyticsMainGoal": "E_COMMERCE",
			"url": "https://www.new-example.com"
		},
		"success": true,
		"errors": []
}

Delete Site

Delete a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Disable Site

Disable kameleoon.js on a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id/disable
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/disable" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Enable Site

Enable kameleoon.js on a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/site/:id/enable
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/enable" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Experiment

Create Experiment

Create a experiment on a site with default values. Site ID is required in the URL.

https://api.kameleoon.com/k-api/experiment?siteId=:siteId
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"name":"experiment name"
}' \
"https://api.kameleoon.com/k-api/experiment?siteId=1" \

Parameter

Field Type Description
name optional String

Name of the Experiment.

HTTP/1.1 200 OK
{
		"result": {
			"goalId": null,
			"name": "experiment name",
			"siteId": 14794,
			"variationsId": "[]",
			"id": 27856,
			"experimentStatus": "draft"
		},
		"success": true,
		"errors": []
	}

Get Experiment

Get the information of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1" \
HTTP/1.1 200 OK
{
		"result": {
			"targetingSegmentId": 1,
			"reportingTools": {
				"repotingToolsValues": [
					"[Newsletter]"
				],
				"repotingToolsNames": [
					"kameleoonTracking"
				]
			},
			"deviations": {
				"1": 0.3,
				"reference": 0.7
			},
			"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"mainGoal": "22560",
			"variations": [
				1,
				2
			],
			"name": "Test 45 (copy of Test 35)",
			"siteId": 1,
			"id": 1,
			"experimentStatus": "DRAFT",
			"goals": [
				1
			]
		},
		"success": true,
		"errors": []
	}

Get list of Experiments

Get the list of experiments for a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/experiment?:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/experiment?siteId=1" \
    HTTP/1.1 200 OK
    {
    		"result": {
    			"experiments": [
					{
    					"targetingSegmentId": 1,
    					"reportingTools": {
    						"repotingToolsValues": [
    							"[Newsletter]"
    						],
    						"repotingToolsNames": [
    							"kameleoonTracking"
    						]
    					},
    					"deviations": {
    						"1": 0.3,
    						"reference": 0.7
    					},
    					"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
    					"scheduleCronStart": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
    					"mainGoal": "22560",
    					"variations": [
    						1,
    						2
    					],
    					"name": "Test 45 (copy of Test 35)",
    					"siteId": 1,
    					"id": 1,
    					"experimentStatus": "DRAFT",
    					"goals": [
    						1
    					]
    				}
    			]
    		},
    		"success": true,
    		"errors": []
    	}

Update Experiment

Update the information of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-d '{
		"siteId":14797,
		"experimentStatus":"PAUSE"
}' \
"https://api.kameleoon.com/k-api/experiment/1" \

Parameter

Field Type Description
siteId String

id of the Site associated with Experiment.

name String

new Experiment name.

experimentStatus String

new Experiment status.

Allowed values: {ACTIVE, PAUSE, ENDED}

segmentId optional String

Id of Targeting Segment to bind with Experiment.

deviation optional JsonObject

Deviation as json.

reference Float

Part of audience go by main reference.

Ordre de grandeur : 0..1

:variationId Float

Part of audience go by variation with id=variationId.

Ordre de grandeur : 0..1

HTTP/1.1 200 OK
{
		"result": {
			"targetingSegmentId": 45667,
			"reportingTools": {
				"repotingToolsValues": [
					[
						"Engagement"
					]
				],
				"repotingToolsNames": [
					"kameleoonTracking"
				]
			},
			"deviations": {
				"115466": 0.32,
				"reference": 0.68
			},
			"scheduleCronStop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
			"scheduleCronStart": "",
			"mainGoal": "22752",
			"variations": [],
			"name": "Test 1",
			"siteId": 14797,
			"id": 27860,
			"experimentStatus": "PAUSE",
			"goals": [
				22752
			]
		},
		"success": true,
		"errors": []
	}

Duplicate Experiment

Duplicate an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1" \
HTTP/1.1 200 OK
{
		"result": {
		     "targetingSegmentId": 1,
		     "reportingTools": {
		     	"repotingToolsValues": [],
		     	"repotingToolsNames": []
		     },
		     "deviations": {},
		     "scheduleCronStop": "",
		     "scheduleCronStart": "",
		     "variations": [],
		     "name": "Test 2 (copy of Test 1)",
		     "siteId": 1,
		     "id": 1,
		     "experimentStatus": "DRAFT",
		     "goals": []
		},
		"success": true,
		"errors": []
	}

Create/Update Experiment Schedule

Create or Update (if experiment not started yet) a schedule for an experiment. You must specify schedule either as cron or as date. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id/schedule
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"date": {
			"start": {
		 		"weekday": [1,2,3,4,5],
		 		"hour": [8]
			},
			"stop": {
		 		"weekday": [1,2,3,4,5],
		 		"hour": [22]
		 	}
		}
}' \
"https://api.kameleoon.com/k-api/experiment/1/schedule" \

Parameter

Field Type Description
cron optional JsonObject

Start and stop date as cron expression.

start String

Start experiment schedule.

stop optional String

Stop experiment schedule.

date optional JsonObject

Start and stop date as JsonArray.

start JsonObject

Start experiment schedule.

minute optional JsonArray

Start experiment since minute.

Default value: 0

Ordre de grandeur : 0-59

hour optional JsonArray

Start experiment since hour.

Default value: every

Ordre de grandeur : 0-23

day optional JsonArray

Start experiment since day.

Default value: every

Ordre de grandeur : 1-31

month optional JsonArray

Start experiment since month.

Default value: every

Ordre de grandeur : 1-12

weekday optional JsonArray

Start experiment since weekday. Sunday = 1.

Default value: every

Ordre de grandeur : 1-7

year optional JsonArray

Start experiment since year.

Default value: every

stop optional JsonObject

Stop experiment schedule.

minute optional JsonArray

Stop experiment since minute.

Default value: 0

Ordre de grandeur : 0-59

hour optional JsonArray

Stop experiment since hour.

Default value: every

Ordre de grandeur : 0-23

day optional JsonArray

Stop experiment since day.

Default value: every

Ordre de grandeur : 1-31

month optional JsonArray

Stop experiment since month.

Default value: every

Ordre de grandeur : 1-12

weekday optional JsonArray

Stop experiment since weekday. Sunday = 1.

Default value: every

Ordre de grandeur : 1-7

year optional JsonArray

Stop experiment since year.

Default value: every

HTTP/1.1 200 OK
{
		"result": {
			"schedule": {
				"start": "At 8:00 AM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016",
				"stop": "At 10:00 PM, only on Sunday, Monday, Tuesday, Wednesday and Thursday, only in 2016"
			}
		},
		"success": true,
		"errors": []
	}

Experiment Results

Get the results of an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id/result?interval=:interval
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1/result?interval=hour" \

Parameter

Field Type Description
interval optional String

Interval for getting results.

Default value: DAY

Allowed values: HOUR, DAY, WEEK, MONTH, YEAR

Success 200

Field Type Description
goals JsonArray

List of Goals.

goalId JsonObject

Contains list of variations.

id Number

Variation id. "reference" - case for absence of any variations. "winner" - the best variation.

name String

The variation name.

trustRate Number

The trust rate.

improvement Number

Relative improvement over absence of any variations, computed as the ratio of conversionRate values minus 1.

conversionRate Number

Conversion rate, computed as conversions/visitors for this variation.

visits Number

Number of site visitors for this variation.

allConversions Number

All conversions during the test.

convertedVisits Number

Visits who have converted the goal.

HTTP/1.1 200 OK
{
		"result": {
			"goals": [
				"20292": {
					"111643": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}",
					"112435": "{name=MENU HORIZONTAL Fusion Musique (B), id=112435, Improvement=+6.58%, StatisticalSignificance=99.80%, allConversions=5,944, visits=16,517, convertedVisits=2,532, ConversionRate=15.33%}",
					"112436": "{name=MENU HORIZONTAL Fusion Son (C), id=112436, Improvement=+5.62%, StatisticalSignificance=99.31%, allConversions=6,129, visits=16,549, convertedVisits=2,514, ConversionRate=15.19%}",
					"112437": "{name=MENU HORIZONTAL Fusion Musique et Son (D), id=112437, Improvement=+8.23%, StatisticalSignificance=99.98%, allConversions=6,108, visits=16,510, convertedVisits=2,570, ConversionRate=15.57%}",
					"112920": "{name=Référence Bis Sans Lien Niveau 1, id=112920, Improvement=-100.00%, StatisticalSignificance=--, allConversions=0, visits=0, convertedVisits=0, ConversionRate=0.00%}",
					"reference": "{name=reference, id=reference, Improvement=+0.00%, StatisticalSignificance=--, allConversions=13,659, visits=40,930, convertedVisits=5,887, ConversionRate=14.38%}",
					"winner": "{name=MENU HORIZONTAL (A), id=111643, Improvement=+9.22%, StatisticalSignificance=100.00%, allConversions=6,369, visits=16,551, convertedVisits=2,600, ConversionRate=15.71%}"
				}
			]
		}
		"success": true,
		"errors": []
	}

Export Experiment Results

Export experiment results to csv file.

https://api.kameleeon.com/k-api/experiment/:id/export?interval=hour
wget \
--header="X-Auth-Key:2MSO9VFIUSPI6YU" \
--header="X-Auth-Email:a@a.com" \
https://api.kameleoon.com/k-api/experiment/1/export?interval=hour \
--no-check-certificate \
--content-disposition \

Parameter

Field Type Description
interval optional String

Interval for getting results.

Default value: DAY

Allowed values: HOUR, DAY, WEEK, MONTH, YEAR

Delete Experiment

Delete an experiment. Experiment ID is required in the URL.

https://api.kameleeon.com/k-api/experiment/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/:id" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Variation

Create Variation

Create a variation on an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/variation
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"variation name",
     "jsCode":"variation js",
     "cssCode":"variation css"
}'
"https://api.kameleoon.com/k-api/experiment/1/variation" \

Parameter

Field Type Description
name String

The variation name.

jsCode optional String

The variation javascript code.

cssCode optional String

The variation css style.

waitDOMReady optional Boolean

Is js code applied after DOM ready.

Default value: true

HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js"
		},
		"success": true,
		"errors": []
}

Get Variation

Get the information of a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js"
		},
		"success": true,
		"errors": []
}

Get list of Variations

Get the list of variations for an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/variations
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/experiment/1/variations" \
HTTP/1.1 200 OK
{
		"result": {
			"variations": [
				{
					"customCssCode": "variation css",
					"waitDOMReady": true,
					"name": "variation name",
					"id": 1,
					"attachedExperimentId": 1,
					"javaScriptCode": "variation js"
				}
			],
		},
		"success": true,
		"errors": []
}

Update Variation

Update the information of a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "jsCode":"variation js new",
     "cssCode":"variation css new"
}' \
"https://api.kameleoon.com/k-api/variation/1" \

Parameter

Field Type Description
jsCode optional String

New javascript code for variation.

cssCode optional String

New css style for variation.

waitDOMReady optional Boolean

Set true if code applied after DOM ready.

Default value: true

HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": "variation css new",
			"waitDOMReady": true,
			"name": "variation name",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": "variation js new"
		},
		"success": true,
		"errors": []
}

Duplicate Variation

Duplicate a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {
			"customCssCode": null,
			"waitDOMReady": true,
			"name": "Copy of (Variation 1)",
			"id": 1,
			"attachedExperimentId": 1,
			"javaScriptCode": null
		},
		"success": true,
		"errors": []
}

Delete Variation

Delete a variation. Variation ID is required in the URL.

/k-api/variation/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/variation/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
}

Goal

Create Goal

Create a goal on a site. Site ID is required in the URL.

/k-api/site/:id/goal
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name",
     "goalType":"URL"
}'
"https://api.kameleoon.com/k-api/site/1/goal" \

Parameter

Field Type Description
name String

Goal name.

goalType String

Type of Goal.

Allowed values: ENGAGEMENT, CLICK, URL, PAGE_VIEWS, TIME_SPENT, CUSTOM

HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": null,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Get Goal

Get a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": null,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Get list of Site Goals

Get the list of goals associated with a site. Site ID is required in the URL.

/k-api/site/:id/goals
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/goals" \
HTTP/1.1 200 OK
{
		"result": {
			"mainPersonalizationGoal": null,
			"goals": [
				{
	    			"piwikEventTracking": true,
	    			"adobeOmnitureEventTracking": true,
	    			"kissMetricsEventTracking": true,
	    			"comScoreEventTracking": true,
	    			"matchType": "null",
	    			"attachedGoalName": null,
	    			"masterGoalId": null,
 				"multipleConversions": false,
	    			"type": "URL",
	    			"heatMapEventTracking": true,
	    			"action": null,
	    			"experimentId": null,
	    			"selector": null,
	    			"id": 1,
	    			"eulerianEventTracking": true,
	    			"crazyEggEventTracking": true,
	   			 	"mentalistWeight": 0,
	    			"timeSpent": null,
	   			 	"attachedGoalId": null,
	   			 	"universalAnalyticsEventTracking": true,
	    			"url": null,
	   			 	"googleAnalyticsEventTracking": true,
	    			"pageViews": null,
	    			"name": null,
	    			"attached": false,
	    			"webtrendsEventTracking": true,
		   			"reportingScriptEventTracking": true,
		   			"category": null,
	    			"atInternetEventTracking": true
				}
			]
		},
		"success": true,
		"errors": []
	}

Get list of Experiment Goals

Get the list of goals associated with an experiment. Experiment ID is required in the URL.

/k-api/experiment/:id/goal
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name",
     "goalType":"URL"
}'
"https://api.kameleoon.com/k-api/experiment/1/goal" \

Parameter

Field Type Description
name String

Goal name.

goalType String

Type of Goal.

Allowed values: ENGAGEMENT, CLICK, URL, PAGE_VIEWS, TIME_SPENT, CUSTOM

HTTP/1.1 200 OK
{
		"result": {
			"mainGoal": {
				"piwikEventTracking": true,
				"adobeOmnitureEventTracking": true,
				"kissMetricsEventTracking": true,
				"comScoreEventTracking": true,
				"matchType": "null",
				"attachedGoalName": null,
				"masterGoalId": 22751,
				"multipleConversions": false,
				"type": "ENGAGEMENT",
				"heatMapEventTracking": true,
				"action": null,
				"experimentId": 1,
				"selector": null,
				"id": 2,
				"eulerianEventTracking": true,
				"crazyEggEventTracking": true,
				"mentalistWeight": 0,
				"timeSpent": null,
				"attachedGoalId": null,
				"universalAnalyticsEventTracking": true,
				"url": null,
				"googleAnalyticsEventTracking": true,
				"pageViews": null,
				"name": "Engagement",
				"attached": false,
				"webtrendsEventTracking": true,
				"reportingScriptEventTracking": true,
				"category": null,
				"atInternetEventTracking": true
			}
			"goals": [
				{
	    			"piwikEventTracking": true,
	    			"adobeOmnitureEventTracking": true,
	    			"kissMetricsEventTracking": true,
	    			"comScoreEventTracking": true,
	    			"matchType": "null",
	    			"attachedGoalName": null,
	    			"masterGoalId": null,
 				"multipleConversions": false,
	    			"type": "URL",
	    			"heatMapEventTracking": true,
	    			"action": null,
	    			"experimentId": null,
	    			"selector": null,
	    			"id": 1,
	    			"eulerianEventTracking": true,
	    			"crazyEggEventTracking": true,
	   			 	"mentalistWeight": 0,
	    			"timeSpent": null,
	   			 	"attachedGoalId": null,
	   			 	"universalAnalyticsEventTracking": true,
	    			"url": null,
	   			 	"googleAnalyticsEventTracking": true,
	    			"pageViews": null,
	    			"name": null,
	    			"attached": false,
	    			"webtrendsEventTracking": true,
		   			"reportingScriptEventTracking": true,
		   			"category": null,
	    			"atInternetEventTracking": true
				}
			]
		},
		"success": true,
		"errors": []
	}

Update Goal

Update the information of a goal. Goal ID is required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"goal name new",
     "goalType":"TIME_SPENT"
}'
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "TIME_SPENT",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": "goal name new,
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
	}

Duplicate Goal

Duplicate a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=1
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"piwikEventTracking": true,
	    	"adobeOmnitureEventTracking": true,
	    	"kissMetricsEventTracking": true,
	    	"comScoreEventTracking": true,
	    	"matchType": "null",
	    	"attachedGoalName": null,
	    	"masterGoalId": null,
 		"multipleConversions": false,
	    	"type": "URL",
	    	"heatMapEventTracking": true,
	    	"action": null,
	    	"experimentId": null,
	    	"selector": null,
	    	"id": 1,
	    	"eulerianEventTracking": true,
	    	"crazyEggEventTracking": true,
	    	"mentalistWeight": 0,
	    	"timeSpent": null,
	    	"attachedGoalId": null,
	    	"universalAnalyticsEventTracking": true,
	    	"url": null,
	    	"googleAnalyticsEventTracking": true,
	    	"pageViews": null,
	    	"name": "Copy of (Goal 1 name)",
	    	"attached": false,
	    	"webtrendsEventTracking": true,
		    "reportingScriptEventTracking": true,
		    "category": null,
	    	"atInternetEventTracking": true
		},
		"success": true,
		"errors": []
}

Delete Goal

Delete a goal. Goal ID and Site ID are required in the URL.

/k-api/goal/:id?siteId=:siteId
curl -k -X Delete \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/goal/1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Targeting Segment

Create TargetingSegment

Create a targeting segment on a site. Site id is required in the URL.

/k-artiart/site/:id/segment
curl -k \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "siteId":1,
     "name":"segment name",
     "description":"segment description",
     "conditionsData": {
         "firstLevelOrOperators": [
         	true,
         	false,
         	true
         ],
         "secondLevel": [
         	{
         		"orOperators": [
         			false
         	    ],
       			"conditions": [
       				{
       					"targetingType": "DEVICE_TYPE",
       					"device": "DESKTOP",
       					"include": "true",
       					"weight": 1
       				},
       				{
       					"targetingType": "BROWSER_LANGUAGE",
       					"language": "af",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		},
       		{
       			"orOperators": [
       				false
       			],
       			"conditions": [
       				{
       					"targetingType": "PAGE_VIEWS",
       					"pageCount": "10",
       					"countOp": "GREATER",
       					"include": "true",
       					"weight": 1
       				},
       				{
       					"targetingType": "ORIGIN_TYPE",
       					"trafficType": "DIRECT",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		},
       		{
       			"orOperators": [],
       			"conditions": [
       				{
       					"targetingType": "SEARCH_KEYWORD",
       					"keyword": "search+word",
       					"matchType": "EXACT",
       					"include": "true",
       					"weight": 1
       				}
       			]
       		}
       	]
     }
}' \
"https://api.kameleoon.com/k-api/site/1/segment" \

Parameter

Field Type Description
name String

Targeting segment name.

description optional String

Targeting segment description.

conditionsData optional JsonObject

Targeting segment conditions.

conditionsData

Field Type Description
firstLevelOrOperators optional JsonArray

Array of booleans ("or"=true, "and"=false) for binding secondLevel outer conditions.

secondLevel optional JsonArray

Array of JsonObjects with outer conditions.

secondLevel

Field Type Description
orOperators optional JsonArray

Boolean ("or"=true, "and"=false) for binding secondLevel inner conditions.

conditions optional JsonArray

JsonArray with secondLevel inner conditions.

conditions

Field Type Description
targetingType String

Targeting condition type. According to this field it's necessary to add some additional fields as shown below!

Allowed values: PAGE_URL, PAGE_TITLE, LANDING_PAGE, ORIGIN, ORIGIN_TYPE, SEARCH_KEYWORD, NEW_VISITORS, BROWSER_LANGUAGE, GEOLOCATION, DEVICE_TYPE, PREVIOUS_PAGE, PAGE_VIEWS, FIRST_VISIT, LAST_VISIT, ACTIVE_SESSION, TIME_SINCE_PAGE_LOAD, SAME_DAY_VISITS, VISITS, MOUSE_OUT, CONVERSIONS, INTERNAL_SEARCH_KEYWORDS, TABS_ON_SITE, WEATHER, DAY_OF_WEEK, TIME_RANGE, HOUR_MINUTE_RANGE, JS_CODE, COOKIE, EVENT, BROWSER, OPERATING_SYSTEM, DOM_ELEMENT

PAGE_URL

Field Type Description
url String

URL template.

matchType optional String

Accordance between requested URL and URL template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

PAGE_TITLE

Field Type Description
title String

Title template.

matchType optional String

Accordance between page title and title template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

LANDING_PAGE

Field Type Description
url String

Landing URL template.

matchType optional String

Accordance between requested URL and landing URL template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

ORIGIN

Field Type Description
url String

Referring website URL template.

matchType optional String

Accordance between visitors origin URL and referring website URL template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

ORIGIN_TYPE

Field Type Description
trafficType String

Traffic type.

Allowed values: SEO, SEM, AFFILIATION, EMAIL, DIRECT

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

SEARCH_KEYWORD

Field Type Description
keyword String

AdWords search keywords.

matchType optional String

Accordance between visitors search word and keyword.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

NEW_VISITORS

Field Type Description
visitorsType String

New or returning visitors.

Allowed values: NEW, RETURNING

weight optional Integer

More important conditions have greater values.

Default value: 1

BROWSER_LANGUAGE

Field Type Description
language String

Browser language code in ISO 639-1.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

GEOLOCATION

Field Type Description
country String

IP location country.

region optional String

IP location region.

city optional String

IP location city.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

DEVICE_TYPE

Field Type Description
device String

Device type.

Allowed values: DESKTOP, TABLET, PHONE

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

PREVIOUS_PAGE

Field Type Description
url String

Previous page URL template.

matchType optional String

Accordance between previous page URL and URL template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

PAGE_VIEWS

Field Type Description
pageCount Integer

Number of page views.

countOp String

Operand for pageCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

FIRST_VISIT

Field Type Description
dayCount Integer

Days elapsed since first visit.

countOp String

Operand for dayCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

LAST_VISIT

Field Type Description
dayCount Integer

Days elapsed since last visit .

countOp String

Operand for dayCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

ACTIVE_SESSION

Field Type Description
secondCount Integer

Seconds elapsed since session became active.

countOp String

Operand for secondCount.

Allowed values: LOWER, GREATER

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

TIME_SINCE_PAGE_LOAD

Field Type Description
secondCount Integer

Seconds elapsed since page load.

countOp String

Operand for secondCount.

Allowed values: LOWER, GREATER

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

SAME_DAY_VISITS

Field Type Description
visitCount Integer

Number of visits for day.

countOp String

Operand for visitCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

VISITS

Field Type Description
visitCount Integer

Total number of visits.

countOp String

Operand for visitCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

MOUSE_OUT

Field Type Description
weight optional Integer

More important conditions have greater values.

Default value: 1

CONVERSIONS

Field Type Description
goal String

Goal that have reached by visitors.

Allowed values: ANY, ENGAGEMENT, :GOAL_ID

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

INTERNAL_SEARCH_KEYWORDS

Field Type Description
keyword String

On site search keyword.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

TABS_ON_SITE

Field Type Description
tabCount Integer

Number of tabs opened.

countOp String

Operand for tabCount.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

DAY_OF_WEEK

Field Type Description
day String

Weekday.

Allowed values: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

TIME_RANGE

Field Type Description
since String

Since date. Date format: dd/mm/yyyyThh:MM.

to String

To date. Date format: dd/mm/yyyyThh:MM.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

HOUR_MINUTE_RANGE

Field Type Description
since String

Since time. Time format: hh:MM.

to String

To time. Time format: hh:MM.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

JS_CODE

Field Type Description
jsCode String

Custom JavaScript condition.

applied optional String

Run js code after DOM ready or immediate?

Default value: DOM_READY

Allowed values: DOM_READY, IMMEDIATE

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

COOKIE

Field Type Description
name String

Browser cookie name template.

value optionnel String

Wait while DOM is ready.

matchType optional String

Accordance between visitors cookie name and cookie name template.

Default value: EXACT

Allowed values: EXACT, CONTAINS, REGULAR_EXPRESSION

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

EVENT

Field Type Description
event String

Custom event.

weight optional Integer

More important conditions have greater values.

Default value: 1

BROWSER

Field Type Description
browser String

Browser.

Allowed values: CHROME, IE, FIREFOX, SAFARI, OPERA

version Integer

Browser version.

versionOp String

Operand for version.

Allowed values: LOWER, GREATER, EQUAL

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

OPERATING_SYSTEM

Field Type Description
os String

Operating system.

Allowed values: WINDOWS, LINUX, MAC_OS, ANDROID, IOS

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

DOM_ELEMENT

Field Type Description
elementType String

Type of element on the page.

Allowed values: ANY_MODIFIED, SINGLE

elementValue optional String

Element on the page (id, class, ...) if elementType is SINGLE.

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

WEATHER

Field Type Description
weather String

Weather in client place.

Allowed values: CLEAR, CLOUDY, DRIZZLE, RAIN, THUNDERSTORM, HAIL, SNOW, CALM, BREEZE, HIGH_WIND, DISTURBED, HOT, COLD, SETTING

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

REFERRERS

Field Type Description
referrer String

The visitors referrer.

Allowed values: ANY_REFERRER, GOOGLE_ADWORDS, GOOGLE_SEARCH, BING_SEARCH, YAHOO_SEARCH, BAIDU_SEARCH

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

INTERESTS

Field Type Description
interest String

The visitor interests.

Allowed values: ANY, :INTEREST_NAME

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

KEY_PAGES

Field Type Description
pages String

Key pages that have visited visitors.

Allowed values: ANY, :KEY_PAGES_NAME

weight optional Integer

More important conditions have greater values.

Default value: 1

isInclude optional Boolean

Is include if match this condition?

Default value: true

Get TargetingSegment

Get the information of a targeting segment. Segment id and siteId are required in the URL.

/k-api/segment/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/segment/1" \

Update TargetingSegment

The segment id and siteId are required in the URL. Only targeting conditions will be updated. For more description see 'Create TargetingSegment' section.

/k-api/segment/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
     "name":"json name new",
     "description":"json description new",
     "conditionsData": {
         "secondLevel": [
             {
                 "conditions": [
                     {
                         "targetingType": "SEARCH_KEYWORD",
                         "keyword": "search+word+new",
                         "include": "true",
                         "weight": 1
                     }
                 ]
             }
         ]
     }
}' \
"https://api.kameleoon.com/k-api/segment/1?siteId=1" \

Parameter

Field Type Description
conditionsData JsonObject

New targeting condition data.

Update TargetingSegment Condition

TargetingSegment id is required in the url. Search targetingCondition by targetingType and mandatory field for this targetingType and update conditions for founded targeting condition.

/k-api/condition/:id
curl -k \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
      "conditions": [
              {
       		    "targetingType": "DEVICE_TYPE",
       		    "oldValue": "MOBILE",
       			"device": "DESKTOP",
       			"include": "true",
       			"weight": 1
       		},
       		{
       			"targetingType": "BROWSER_LANGUAGE",
       		    "oldValue": "aa",
       			"language": "af",
       			"include": "true",
       			"weight": 1
       		}
      ]
}' \
"https://api.kameleoon.com/k-api/condition/1" \

Parameter

Field Type Description
conditions JsonArray

Array of conditions to update.

targetingType String

Condition TargetingType.

oldValue String

Value for mandatory field for this targetingType (see Create TargetingSegment).

Delete TargetingSegment

Delete a targeting segment. Segment ID and Site ID are required in the URL.

/k-api/segment/:id?siteId=:siteId
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/segment/1" \

Parameter

Field Type Description
conditionsData JsonObject

New targeting condition data.

List of TargetingSegment

Get the list of targeting segments for a site. Site ID is required in the URL.

/k-api/site/:id/segments
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/site/1/segments" \

Personalization

Create Personalization

Create a personalization on a site with default values. Site ID is required in the URL.

https://api.kameleeon.com/k-api/personalization?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization?siteId=1" \
-d '{
		"name":"perso"
}' \

Parameter

Field Type Description
name String

name of Personalization.

HTTP/1.1 200 OK
{
		"result": {
			"cappingPerVisitorConvertGoal": false,
			"goalId": null,
			"popIn": null,
			"description": null,
			"pluginCountDownHeadband": null,
			"globalCappingVisitorsConfiguration": "null",
			"variation": "{name=Variation 1, id=115495}",
			"expositionFrequencySameVisit": null,
			"targetingSegmentId": 45733,
			"trackerData": null,
			"cappingPerVisitorNumberExpositions": false,
			"archived": false,
			"kameleoonTracking": true,
			"pluginGoogleForm": null,
			"customContent": "{customCSS=null, customJavaScript=null}",
			"dateStarted": null,
			"dateEnded": null,
			"goals": [],
			"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
			"expositionFrequencySameVisitorDelaySeconds": null,
			"stickyBlock": null,
			"expositionFrequencySameVisitor": null,
			"id": 17995,
			"expositionFrequencySameVisitorMax": 8,
			"globalCappingNumberVisitors": false,
			"cappingPerVisitorGoalId": null,
			"pluginIAdvize": null,
			"personalizationCheckConditionsRule": "ALL_CONDITIONS",
			"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
			"personalizationStatus": "DRAFT",
			"pluginSocialBar": null,
			"priority": 1,
			"pluginAdBlock": null,
			"personalizationConfiguration": "NONE",
			"variationId": 115495,
			"globalCappingGoalId": null,
			"customExpositionRate": 100,
			"name": "perso",
			"siteId": 14797,
			"imageInPage": null
		},
		"success": true,
		"errors": []
	}

Get Personalization

Get the information of a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": {
				"cappingPerVisitorConvertGoal": false,
				"goalId": null,
				"popIn": null,
				"description": null,
				"pluginCountDownHeadband": null,
				"globalCappingVisitorsConfiguration": "null",
				"variation": "{name=Variation 1, id=115495}",
				"expositionFrequencySameVisit": null,
				"targetingSegmentId": 45733,
				"trackerData": null,
				"cappingPerVisitorNumberExpositions": false,
				"archived": false,
				"kameleoonTracking": true,
				"pluginGoogleForm": null,
				"customContent": "{customCSS=null, customJavaScript=null}",
				"dateStarted": null,
				"dateEnded": null,
				"goals": [],
				"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
				"expositionFrequencySameVisitorDelaySeconds": null,
				"stickyBlock": null,
				"expositionFrequencySameVisitor": null,
				"id": 17995,
				"expositionFrequencySameVisitorMax": 8,
				"globalCappingNumberVisitors": false,
				"cappingPerVisitorGoalId": null,
				"pluginIAdvize": null,
				"personalizationCheckConditionsRule": "ALL_CONDITIONS",
				"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
				"personalizationStatus": "DRAFT",
				"pluginSocialBar": null,
				"priority": 1,
				"pluginAdBlock": null,
				"personalizationConfiguration": "NONE",
				"variationId": 115495,
				"globalCappingGoalId": null,
				"customExpositionRate": 100,
				"name": "perso",
				"siteId": 14797,
				"imageInPage": null
			}
		},
		"success": true,
		"errors": []
	}

Get list of Personalizations

Get the list of personalizations of a site. Site ID is required in the URL.

https://api.kameleeon.com/k-api/personalization?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": [
				{
					"cappingPerVisitorConvertGoal": false,
					"goalId": null,
					"popIn": null,
					"description": null,
					"pluginCountDownHeadband": null,
					"globalCappingVisitorsConfiguration": "null",
					"variation": "{name=Variation 1, id=115495}",
					"expositionFrequencySameVisit": null,
					"targetingSegmentId": 45733,
					"trackerData": null,
					"cappingPerVisitorNumberExpositions": false,
					"archived": false,
					"kameleoonTracking": true,
					"pluginGoogleForm": null,
					"customContent": "{customCSS=null, customJavaScript=null}",
					"dateStarted": null,
					"dateEnded": null,
					"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
					"expositionFrequencySameVisitorDelaySeconds": null,
					"stickyBlock": null,
					"expositionFrequencySameVisitor": null,
					"id": 17995,
					"expositionFrequencySameVisitorMax": 8,
					"globalCappingNumberVisitors": false,
					"cappingPerVisitorGoalId": null,
					"pluginIAdvize": null,
					"personalizationCheckConditionsRule": "ALL_CONDITIONS",
					"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
					"personalizationStatus": "DRAFT",
					"pluginSocialBar": null,
					"priority": 1,
					"pluginAdBlock": null,
					"personalizationConfiguration": "NONE",
					"variationId": 115495,
					"globalCappingGoalId": null,
					"customExpositionRate": 100,
					"name": "perso",
					"siteId": 14797,
					"imageInPage": null
				}
			]
		},
		"success": true,
		"errors": []
	}

Update Personalization

Update the information of a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X PUT \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
-d '{
		"name":"perso new"
}' \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \

Parameter

Field Type Description
name optionnel String

name of Personalization.

targetingSegmentId optional String

Targeting segment id for binding with personalization.

description optional String

description of Personalization.

personalizationStatus optional String

status of Personalization. Can be: DRAFT, ACTIVE, PAUSE, ENDED

customExpositionRate optional Number

percent of Visitors exposed with personalization

priority optional Number

priority of personalization

resetExpositionFrequencySameVisit optional Boolean

if true exposition frequency functions will be reseted.

expositionFrequencySameVisit optional Number

Maximum times of display personalization during a unique visit

expositionFrequencySameVisitor optional Number

Maximum times of display personalization to the same visitor every n milliseconds

expositionFrequencySameVisitorDelaySeconds optional Number

Number of milliseconds for repeating exposition behaviour

expositionFrequencyDelaySecondsBetweenTwoExpositions optional Number

Number of millisecond betveen two expositions of personalization

maxNumberVisitorsExposed optional Number  
HTTP/1.1 200 OK
{
		"result": {
			"site": {
				"includeJQuery": false,
				"name": "b@b.com",
				"id": 1,
				"googleAnalyticsProfile": null,
				"googleAnalyticsMainGoal": "E_COMMERCE",
				"url": "http://www.gallery-belyaevo.ru"
			},
			"personalizations": {
				"cappingPerVisitorConvertGoal": false,
				"goalId": null,
				"popIn": null,
				"description": null,
				"pluginCountDownHeadband": null,
				"globalCappingVisitorsConfiguration": "null",
				"variation": "{name=Variation 1, id=115495}",
				"expositionFrequencySameVisit": null,
				"targetingSegmentId": 45733,
				"trackerData": null,
				"cappingPerVisitorNumberExpositions": false,
				"archived": false,
				"kameleoonTracking": true,
				"pluginGoogleForm": null,
				"customContent": "{customCSS=null, customJavaScript=null}",
				"dateStarted": null,
				"dateEnded": null,
				"goals": [],
				"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
				"expositionFrequencySameVisitorDelaySeconds": null,
				"stickyBlock": null,
				"expositionFrequencySameVisitor": null,
				"id": 17995,
				"expositionFrequencySameVisitorMax": 8,
				"globalCappingNumberVisitors": false,
				"cappingPerVisitorGoalId": null,
				"pluginIAdvize": null,
				"personalizationCheckConditionsRule": "ALL_CONDITIONS",
				"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
				"personalizationStatus": "DRAFT",
				"pluginSocialBar": null,
				"priority": 1,
				"pluginAdBlock": null,
				"personalizationConfiguration": "NONE",
				"variationId": 115495,
				"globalCappingGoalId": null,
				"customExpositionRate": 100,
				"name": "perso new",
				"siteId": 14797,
				"imageInPage": null
			}
		},
		"success": true,
		"errors": []
	}

Duplicate Personalization

Duplicate a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
			"cappingPerVisitorConvertGoal": false,
			"goalId": null,
			"popIn": null,
			"description": null,
			"pluginCountDownHeadband": null,
			"globalCappingVisitorsConfiguration": "null",
			"variation": "{name=Variation 1, id=115495}",
			"expositionFrequencySameVisit": null,
			"targetingSegmentId": 45733,
			"trackerData": null,
			"cappingPerVisitorNumberExpositions": false,
			"archived": false,
			"kameleoonTracking": true,
			"pluginGoogleForm": null,
			"customContent": "{customCSS=null, customJavaScript=null}",
			"dateStarted": null,
			"dateEnded": null,
			"goals": [],
			"expositionFrequencyDelaySecondsBetweenTwoExpositions": null,
			"expositionFrequencySameVisitorDelaySeconds": null,
			"stickyBlock": null,
			"expositionFrequencySameVisitor": null,
			"id": 17995,
			"expositionFrequencySameVisitorMax": 8,
			"globalCappingNumberVisitors": false,
			"cappingPerVisitorGoalId": null,
			"pluginIAdvize": null,
			"personalizationCheckConditionsRule": "ALL_CONDITIONS",
			"targetingSegment": "{id=45733, name=additional, description=additional, conditions={firstLevelOrOperators=[], secondLevel=[{orOperators=[false, false], conditions=[{group=, type=REFERRERS, firstValue=0, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors having the configured referrer Google AdWords, disabled=false, weight=1}, {group=, type=INTERESTS, firstValue=1, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors interested in ya, disabled=false, weight=1}, {group=, type=CONVERSIONS, firstValue=22751, secondValue=null, thirdValue=null, include=true, matchType=EXACT, customTargetingConditionId=null, readableDescription=Visitors who converted the goal goal  name new, disabled=false, weight=1}]}]}, usedInExperiments=0, usedInPersonalizations=1, isBuyerPersonasSegment=false, eCommerceObjectivesNeeded=false}",
			"personalizationStatus": "DRAFT",
			"pluginSocialBar": null,
			"priority": 1,
			"pluginAdBlock": null,
			"personalizationConfiguration": "NONE",
			"variationId": 115495,
			"globalCappingGoalId": null,
			"customExpositionRate": 100,
			"name": "perso new-Duplicate",
			"siteId": 14797,
			"imageInPage": null
		},
		"success": true,
		"errors": []
	}

Personalization Results

Get the results of a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id/result?siteId=:siteId
curl -k -X GET \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
"https://api.kameleoon.com/k-api/personalization/1/result?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {
	    	"exposedConversionRate": 0.2631060756350064,
	    	"goalId": "9279",
	    	"improvementRate": 0.37823074185193684,
	    	"exposedAverageCart": 4860,
	    	"dates": [
	        	1456520400000,
	        	1456606800000,
	        	1456693200000
	        ],
	        "nonExposedConversionCount": 46486,
	        "trustRate": 100,
	        "exposedRevenues": 7405620,
	        "nonExposedConversionRate": 0.1909013256237988,
	        "exposedCount": 272202,
	        "nonExposedAverageCart": 4847,
	        "goalName": "Transaction",
	        "nonExposedRevenues": 4829727,
	        "nonExposedCount": 243508,
	        "exposedConversionCount": 71618,
	        "goals": [
	            12290
	        ]
	    },
		"success": true,
		"errors": []
	}

Delete Personalization

Delete Personalization. Personalization ID is required in the url.

https://api.kameleeon.com/k-api/personalization/:id
curl -k -X DELETE \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-H "Content-Type: application/json" \
"https://api.kameleoon.com/k-api/personalization/1?siteId=1" \
HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}

Personalization Schedule

Create schedule for a personalization. Personalization ID and Site ID are required in the URL.

https://api.kameleeon.com/k-api/personalization/:id/schedule?siteId=:siteId
curl -k -X POST \
-H "X-Auth-Key: ABCDEF123456789" \
-H "X-Auth-Email: a@a.com" \
-d '{
     "scheduleItem":{
         "new_1":{
             "scheduleItemOptions":{
                 "":{
                     "daysOfWeekForShow":"EVERYDAY",
                     "hoursStart":"0",
                     "minutesStart":"0",
                     "hoursEnd":"0",
                     "minutesEnd":"0"
                 },
                 "new_2":{
                     "hoursStart":"10",
                     "hoursEnd":"20"
                 }
             },
             "dateStart":1464728400000,
             "dateEnd":null
         }
     }
 }'
"https://api.kameleoon.com/k-api/personalization/1/schedule?siteId=1" \

Parameter

Field Type Description
scheduleItem String

Contains list of schedules.

new_i String

New schedule item.

dateStart String

Time to start personalization in mills.

dateEnd optional String

Time to end personalization in mills.

scheduleItemOptions optional String

Time to end schedule in mills.

new_ optional String

(i+1)] The schedule description.

HTTP/1.1 200 OK
{
		"result": {},
		"success": true,
		"errors": []
	}
Have more questions? Submit a request
Powered by Zendesk