Retrieving Experiment Configuration Data Programmatically

If you ever need to download a project, experiment and variation configuration data programmatically it is possible through the download of a JSON formatted file, through a REST endpoint.

This will list the following:

  • Project experiences that are Running or Completed.
  • All the meta-data related to the experience.
  • Variation list with its meta-data.
  • Global Project JS
  • Global Experience JS for each one.
  • Code Editor code for each variation.
  • Variation Custom JS
  • Variation Custom CSS


The rest end-point is based on your Project ID

The URL of the endpoint will be formatted like the following:

https://cdn-3.convertexperiments.com/JSON/XXXXXX-XXXXXX.json.

Where XXXXXX-XXXXXX is the number corresponding to your Account ID-Project ID.  You can find both of these on your Convert Tracking Code snippet in your Project Configuration:


This is a sample output of a REST call:

{
"u_id": "10014852",
"prj": {
"utc_of": "0",
"extset": {
"ecommerce": 1,
"csmb": "$",
"maxvis": "0",
"maxtv": "0",
"minordv": 0,
"maxordv": "99999",
"mindays": "14",
"minvis": "5",
"minconv": "5",
"dnt": "0",
"gdprw": "1",
"d_anon": 0,
"g_jq": 0,
"autlnk": 0,
"gaUA": []
},
"id": "10015867",
"name": "Company Name",
"global_d": {
"js": "\nconsole.log('Global Project Javascript');\n\n/*\n\nconvertData.geo.html5country = null;\n\nif (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n\n //GET USER CURRENT LOCATION\n var locCurrent = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n\n //INSERT COUNTRY ON NEW VARIABLE\n var geocoder = new google.maps.Geocoder();\n geocoder.geocode({ 'latLng': locCurrent }, function (results, status) {\n var locItemCount = results.length;\n var locCountryNameCount = locItemCount - 1;\n var locCountryName = results[locCountryNameCount].formatted_address;\n convertData.geo.html5country = locCountryName;\n\n });\n });\n}\n\nfunction cpacpclistLookup (){\n\nfound = false;\ncpa_found = false;\ncpc_found = false;\n\nlowerCaseCPAURLParam = getUrlParameter(\"cpa\");\nupperCaseCPAURLParam = getUrlParameter(\"CPA\");\nlowerCaseCPCURLParam = getUrlParameter(\"cpc\");\nupperCaseCPCURLParam = getUrlParameter(\"CPC\");\n\n// console.log('One not undefined:'+(typeof lowerCaseCPAURLParam != 'undefined' || typeof upperCaseCPAURLParam != 'undefined' || typeof lowerCaseCPCURLParam != 'undefined' || typeof upperCaseCPCURLParam != 'undefined' ));\n\nif (typeof lowerCaseCPAURLParam != 'undefined' || typeof upperCaseCPAURLParam != 'undefined' ||\n typeof lowerCaseCPCURLParam != 'undefined' || typeof upperCaseCPCURLParam != 'undefined' ) {\n\n convert.$.getScript('cpacpclist.js').done(function(data) {\n\n if (typeof lowerCaseCPAURLParam != 'undefined') {\n cpa_found = searchCodes(Codes,\"cpa\",lowerCaseCPAURLParam);\n }\n else if (typeof getUrlParameter(\"CPA\") != 'undefined') {\n cpa_found = searchCodes(Codes,\"cpa\",upperCaseCPAURLParam);\n }\n \n if (cpa_found) {\n console.log(\"cpa found\");\n writeinCookieCodeFound(\"cpa\");\n }\n \n else console.log('cpa not found');\n\n \tif (typeof lowerCaseCPCURLParam != 'undefined') {\n cpc_found = searchCodes(Codes,\"cpc\",lowerCaseCPCURLParam);\n\n \t}\n else if (typeof upperCaseCPCURLParam != 'undefined') {\n cpc_found = searchCodes(Codes,\"cpc\",upperCaseCPCURLParam);\n }\n\n if (cpa_found) {\n console.log(\"cpa found\");\n writeinCookieCodeFound(\"cpa\");\n found = cpa_found;\n }\n else if (cpc_found) {\n console.log('cpc found')\n writeinCookieCodeFound(\"cpc\");\n found = cpc_found;\n }\n else {\n console.log('codes not found');\n }\n });\n}\n}\n\n\nfunction searchCodes(CodesList,ListToSearch,CodeToSearch){\n // console.log('CodesToSearch:'+CodesToSearch);\n //\tconsole.log('itemTofind'+itemTofind);\n\n wasFound = false;\n\n if (ListToSearch == \"cpa\") {\n ArrayToSearch = CodesList.CPA;\n }\n else if (ListToSearch == \"cpc\") {\n ArrayToSearch = CodesList.CPC;\n }\n\n for (var i=0; i<ArrayToSearch.length; i++) {\n console.log(ArrayToSearch[i] + \": \" + ( ArrayToSearch[i] == CodeToSearch));\n \t\tif ( ArrayToSearch[i] == CodeToSearch) {\n \t\t\twasFound = true;\n console.log('Code Found on list:' + wasFound);\n \t\t\tbreak;\n \t\t}\n// else {\n// console.log('Not found inside SearchCodes')\n// }\n }\n return wasFound;\n};\n\nfunction writeinCookieCodeFound (codeType){\n if (codeType == \"cpa\") {\n if (document.cookie.indexOf(\"cpa=true\") == -1) {\n // writes that the code was found on the cpc array\n document.cookie = \"cpa=true\";\n console.log('cpa cookie written');\n }\n }\n else if (codeType == \"cpc\") {\n if (document.cookie.indexOf(\"cpc=true\") == -1) {\n // writes that the code was found on the cpc array\n document.cookie = \"cpc=true\";\n console.log('cpc cookie written');\n }\n }\n\n}\n\n\n\n\nfunction getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n};\n\ncpacpclistLookup();\n\n//-- Google Tag Manager --\n(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','GTM-MPF7QNK');</script>\n//-- End Google Tag Manager --\n\nconvert.$( \"body > div.section.hero > div > div > form\" ).submit(function( event ) {\n dataLayer.push({'event': 'button_click'});\n});\n*/",
"css": null
},
"domains": {
"touristcoin.com": [
"touristcoin.com"
]
},
"domainsCount": 1
},
"experiments": {
"100121730": {
"n": "Code Triggers Test",
"id": 100121730,
"t_r_a": [
[
[
{
"entid": 50,
"compid": "4",
"not": 0,
"repeat": 1,
"timesearch": -2,
"visitsCountSearch": 0,
"data": "https://touristcoin.com/"
}
]
]
],
"t_r_f": [],
"t_seg": [],
"tp": "3",
"integr": [],
"s": "1",
"global_d": {
"js": "console.log('Experience Code');"
},
"sets": {
"minordv": "0",
"maxordv": "99999"
},
"vars": {
"1001174015": {
"p": "0.5",
"secs": [
""
],
"content": {
"js": [
{
"c": "console.log('Variation Code');",
"w": 2
}
],
"html": [
{
"c": "<script type=\"text/javascript\">console.log('Variation Code');</script>",
"w": 0
}
]
},
"chng": [
"Original Page"
],
"active": 1,
"name": "Original"
},
"1001174016": {
"p": "0.5",
"secs": [
""
],
"content": {
"js": [
{
"c": "console.log('Variation Code');",
"w": 2
}
],
"html": [
{
"c": "<script type=\"text/javascript\">console.log('Variation Code');</script>",
"w": 0
}
]
},
"chng": [
"Variation 1"
],
"active": 1,
"name": "Variation 1"
}
},
"vars_sort": [
1001174015,
1001174016
]
}
},
"goals": {
"100123160": {
"add": [
[
[
{
"entid": 16,
"compid": "3",
"not": 1,
"data": 1,
"dn": null,
"repeat": 1,
"timesearch": 0,
"visitsCountSearch": 0
},
{
"entid": 18,
"compid": "3",
"not": 1,
"data": 10,
"dn": null,
"repeat": 1,
"timesearch": 0,
"visitsCountSearch": 0
}
]
]
],
"vpoints": "0",
"tp": "0",
"sts": [],
"isbounce": 1
},
"100123161": {
"add": [],
"vpoints": "0",
"tp": "2",
"sts": {
"nrul": 1,
"evts": [
{
"s": "a",
"ev": "click"
},
{
"s": "form",
"ev": "submit"
}
]
},
"isbounce": 0
},
"100125997": {
"add": [
[
[
{
"entid": "31",
"compid": "4",
"not": 0,
"data": "anything",
"dn": null,
"repeat": null,
"timesearch": null,
"visitsCountSearch": null
}
]
]
],
"vpoints": "0",
"tp": "0",
"sts": [],
"isbounce": 0
},
"100125998": {
"add": [
[
[
{
"entid": "31",
"compid": "4",
"not": 0,
"data": "anything",
"dn": null,
"repeat": null,
"timesearch": null,
"visitsCountSearch": null
}
]
]
],
"vpoints": "0",
"tp": "0",
"sts": [],
"isbounce": 0
},
"100126549": {
"add": [
[
[
{
"entid": "50",
"compid": "6",
"not": 0,
"data": "geotest",
"dn": "",
"repeat": null,
"timesearch": null,
"visitsCountSearch": null
}
],
[
{
"entid": "50",
"compid": "4",
"not": 0,
"data": "https://touristcoin.com/",
"dn": "",
"repeat": null,
"timesearch": null,
"visitsCountSearch": null
}
]
]
],
"vpoints": "0",
"tp": "0",
"sts": [],
"isbounce": 0
},
"100127047": {
"add": [
[
[
{
"entid": "31",
"compid": "6",
"not": 0,
"data": "",
"dn": null,
"repeat": null,
"timesearch": null,
"visitsCountSearch": null
}
]
]
],
"vpoints": "0",
"tp": "2",
"sts": {
"evts": [
{
"ev": "click",
"s": "DIV.w-col.w-col-6.w-col-small-6.w-col-tiny-6.left-nav > A.w-inline-block"
}
]
},
"isbounce": 0
}
},
"segments": []
}