{"_id":"580e6fd7c0a6c23100b76839","version":{"_id":"55aa7d983be8f60d00041d45","__v":20,"project":"55aa7d973be8f60d00041d42","createdAt":"2015-07-18T16:23:52.273Z","releaseDate":"2015-07-18T16:23:52.273Z","categories":["55aa7d983be8f60d00041d46","55aacf4e3be8f60d00041d89","55aacfaae2bdcb0d00c7466e","55aacfb3e2bdcb0d00c7466f","55aacfca3be8f60d00041d8a","55b67da3f8105a2f00c351ab","55b7cae4aea7c8190058ba5b","55b9218afeef5135009b7db3","55c182616d7d2921006da013","5631407afa40240d007c8c60","56548b9c9c4c6d0d00aeda0c","572b9137ff3ba10e00b4abb4","572b9150ff3ba10e00b4abb5","581b83288ca41f0f007e4fb6","585065fa70cbe00f00835bb8","58641eba0355f31900380492","58861760b4816e19005c9941","58a316cb254c401b00a049ce","58ac80dbd5e1570f00d1c328","59f72b4991121a00104f036e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","project":"55aa7d973be8f60d00041d42","user":"55aa7d625d3abb0d0012f3da","parentDoc":null,"__v":1,"category":{"_id":"55c182616d7d2921006da013","pages":["55c184d1c6e9ad3700aaea9c","55c18618c0777c0d004676e1","55c7917eb9aa4e0d0016c3a0"],"version":"55aa7d983be8f60d00041d45","__v":3,"project":"55aa7d973be8f60d00041d42","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-05T03:26:25.875Z","from_sync":false,"order":1,"slug":"javascript-api","title":"Javascript API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-24T20:32:23.388Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"If you need to add additional params for each lead generated in your website, you can add them programmatically with the following code snippet.\n[block:api-header]\n{\n  \"type\": \"options\",\n  \"title\": \"1. Enhance you website script.\"\n}\n[/block]\nRight ** before including the script ** generated in Cliengo to your website, paste the following code snippet to include any additional parameter for each generated lead.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script>\\n    window.leadakiSettings = { \\n      \\tcustomParams : {\\n      \\t\\tcustomParamKey1: '123456789', \\n          customParamKey2: 'superValue'\\n    \\t}\\n    };\\n</script>\\n\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n*customParams* works as a key-value Map. \n\n  * Key: You can specify any name for the key, but it has to be a String.\n  * Value: You can specify any valid json primitive value (string, date, number, boolean)\n  \nAfter all your customParams where specified your final webpage should look like: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n<!-- Start Cliengo Custom Configuration -->\\n<script>\\n    window.leadakiSettings = { \\n      \\tcustomParams : {\\n      \\t\\tcustomParamKey1: '123456789', \\n          customParamKey2: 'superValue'\\n    \\t}\\n    };\\n</script>\\n<!-- End Cliengo Custom Configuration -->\\n\\n<!-- Start Cliengo Installation Code -->\\n<script type=\\\"text/javascript\\\">\\n(function(){\\n  var ldk=document.createElement('script'); \\n  ldk.type='text/javascript'; \\n  ldk.async=true;\\n ldk.src='https://s.cliengo.com/weboptimizer/{companyId}/{websiteId}.js';\\n  var s=document.getElementsByTagName('script')[0];\\n  s.parentNode.insertBefore(ldk, s);})();\\n</script>\\n<!-- End Cliengo Installation Code -->\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]","excerpt":"How to send custom parameters for each lead.","slug":"sending-custom-params","type":"basic","title":"Sending custom params"}

Sending custom params

How to send custom parameters for each lead.

If you need to add additional params for each lead generated in your website, you can add them programmatically with the following code snippet. [block:api-header] { "type": "options", "title": "1. Enhance you website script." } [/block] Right ** before including the script ** generated in Cliengo to your website, paste the following code snippet to include any additional parameter for each generated lead. [block:code] { "codes": [ { "code": "<script>\n window.leadakiSettings = { \n \tcustomParams : {\n \t\tcustomParamKey1: '123456789', \n customParamKey2: 'superValue'\n \t}\n };\n</script>\n", "language": "html" } ] } [/block] *customParams* works as a key-value Map. * Key: You can specify any name for the key, but it has to be a String. * Value: You can specify any valid json primitive value (string, date, number, boolean) After all your customParams where specified your final webpage should look like: [block:code] { "codes": [ { "code": "\n<!-- Start Cliengo Custom Configuration -->\n<script>\n window.leadakiSettings = { \n \tcustomParams : {\n \t\tcustomParamKey1: '123456789', \n customParamKey2: 'superValue'\n \t}\n };\n</script>\n<!-- End Cliengo Custom Configuration -->\n\n<!-- Start Cliengo Installation Code -->\n<script type=\"text/javascript\">\n(function(){\n var ldk=document.createElement('script'); \n ldk.type='text/javascript'; \n ldk.async=true;\n ldk.src='https://s.cliengo.com/weboptimizer/{companyId}/{websiteId}.js';\n var s=document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(ldk, s);})();\n</script>\n<!-- End Cliengo Installation Code -->", "language": "html" } ] } [/block]