cliengo-sdk
Advanced tools
Comparing version 0.9.1 to 0.9.2
@@ -589,2 +589,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
if (!window.hasOwnProperty('GoogleAnalyticsObject')) { | ||
console.log('GoogleAnalyticsObject'); | ||
(function (i, s, o, g, r, a, m) { | ||
@@ -591,0 +592,0 @@ i.GoogleAnalyticsObject = r; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cliengo=t():e.Cliengo=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";function o(e){this.accountId=e.companyId,this.sourceId=e.websiteId,this.whiteLabelId=e.whiteLabelId,this.googleAdWordsConversionId=e.googleAdWordsConversionId,this.googleAnalyticsId=e.googleAnalyticsId,this.chatbotName=e.chatbotName,this.phone=e.phone,this.conversionPixels=e.conversionPixels,this.chatWindowColor=e.chatWindowColor,this.chatWindowTitle=e.chatWindowTitle,this.chatWindowInputPlaceholder=e.chatWindowInputPlaceholder,this.chatInitialMessage=e.chatInitialMessage,this.chatIsWritingMessage=e.chatIsWritingMessage,this.chatSaluteTime=e.chatSaluteTimeInSeconds,this.formHooksEnabled=e.formHooksEnabled,this.contactBarEnabled=e.contactBarEnabled,this.automaticRemarketingEnabled=e.automaticRemarketingEnabled,this.poweredBy=e.poweredBy||{},this.hasConvertedLead=e.hasConvertedLead,this.WS_CHATBOT_URL=e.WS_CHATBOT_URL,this.sessionPath=e.sessionPath,this.debug=e.debug,this.lang=e.lang,this.widgetVersion=e.widgetVersion,this.customSettings=e.customSettings,this.url=e.url}o.prototype.getConvertionPixels=function(){return this.conversionPixels},e.exports={ChatConfig:o}},function(e,t,n){"use strict";function o(e){this.email=e.email,this.phone=e.phone,this.name=e.name,this.nationalIdentityNumber=e.nationalIdentityNumber,this.sourceId=e.sourceId,this.accountId=e.accountId,this.customFields=e.customFields||{},this.gender=e.gender,this.age=e.age,this.lastName=e.lastName,this.address=e.address||{country:null,zipCode:null,city:null,state:null},this.nationality=e.nationality,this.landingUrl=e.landingUrl,this.convertionUrl=e.convertionUrl,this.utmSource=null,this.utmMedium=null,this.utmCampaign=null,this.utmContent=null,this.utmTerm=null,this.utmAdgroup=null,this.gclid=null}o.prototype.addCustomField=function(e,t){this.customFields[e]=t},o.prototype.getCustomField=function(e){return this.customFields[e]},o.prototype.getEmail=function(){return this.email},o.prototype.getPhone=function(){return this.phone},o.prototype.getName=function(){return this.name},o.prototype.getSourceId=function(){return this.sourceId},o.prototype.getAccountId=function(){return this.accountId},o.prototype.getNationalIdentityNumber=function(){return this.nationalIdentityNumber};var i=Object.freeze({UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content",UTM_CAMPAIGN:"utm_campaign",UTM_ADGROUP:"utm_adgroup",GCLID:"gclid"});e.exports={Lead:o,UTMs:i}},function(e,t,n){"use strict";function o(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function i(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+60*n*1e3),o="; expires="+i.toGMTString()}return document.cookie=e+"="+t+o+NaN,e+"="+t+o+NaN}function r(e){var t=a(e);return t?"&"+e+"="+t:""}function a(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(window.location.search)||[,""])[1].replace(/\+/g,"%20"))||null}function c(e,t){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(t)||[,""])[1].replace(/\+/g,"%20"))||null}function d(){var e="";return e+=r("utm_source"),e+=r("utm_medium"),e+=r("utm_term"),e+=r("utm_content"),e+=r("utm_campaign"),e+=r("utm_adgroup"),e+=r("gclid"),i("ldkUtms",e,240),e}e.exports={readCookie:o,createCookie:i,addIfParameterExists:r,getURLParameter:a,getParamFromQueryString:c,setUtmCookies:d}},function(e,t,n){"use strict";function o(e,t){var n=c+d,o=JSON.stringify({leadId:e,sourceId:t}),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(n,r).then(function(e){return e.json()}).catch(function(e){return e})}function i(e,t,n){var o=c+s,i=JSON.stringify({leadId:e,sourceId:t,accountId:n}),r=new window.Headers,a={method:"POST",headers:r,mode:"cors",body:i,cache:"default"};return window.fetch(o,a).then(function(e){return e.json()})}function r(){var e=new window.Headers,t={method:"POST",headers:e,mode:"cors",cache:"default"};return window.fetch(c+u,t).then(function(e){return e.json()})}function a(e){var t=JSON.stringify({response:e}),n=new window.Headers,o={method:"POST",headers:n,mode:"cors",body:t,cache:"default"};return window.fetch(c+l,o).then(function(e){return e.json()}).catch(function(e){return e})}var c="https://fintech.cliengo.com",d="/mocks/veraz/AR/simpleValidation",s="/process/lead/UY",u="/mocks/veraz/AR/step1",l="/mocks/veraz/AR/step2";e.exports={validateIdentity:o,creditAcceptance:i,getSecurityQuestion:r,answerSecurityQuestion:a}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return window.fetch(U+e+"/"+t+".js?configOnly=true").then(function(e){return e.json()}).then(function(e){if(window.leadakiSettings){h("GA",{category:"clgo_stats",action:"custom_settings"}),e.customSettings=window.leadakiSettings}return e.url=document.URL,M=new C.ChatConfig(e),S=M.sourceId,P=M.accountId,a(),e})}function a(){return null===v.default.readCookie("ldkRefererTracking")&&v.default.createCookie("ldkRefererTracking",document.referrer?document.referrer:"direct",240),v.default.setUtmCookies(),_=v.default.readCookie("ldkRefererTracking"),A=v.default.readCookie("ldkUtms"),!0}function c(e){var t=new T.Lead(e),n=v.default.readCookie("ldkUtms");t.accountId=P,t.sourceId=S,t.utmSource=v.default.getParamFromQueryString(T.UTMs.UTM_SOURCE,n)||"",t.utmMedium=v.default.getParamFromQueryString(T.UTMs.UTM_MEDIUM,n)||"",t.utmTerm=v.default.getParamFromQueryString(T.UTMs.UTM_TERM,n)||"",t.utmContent=v.default.getParamFromQueryString(T.UTMs.UTM_CONTENT,n)||"",t.utmCampaign=v.default.getParamFromQueryString(T.UTMs.UTM_CAMPAIGN,n)||"",t.utmAdgroup=v.default.getParamFromQueryString(T.UTMs.UTM_ADGROUP,n)||"",t.gclid=v.default.getParamFromQueryString(T.UTMs.GCLID,n)||"";var o=JSON.stringify(t),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(b+k,r).then(function(e){return e.json()})}function d(e){return y.default.validateIdentity(e,l())}function s(e,t,n){return y.default.creditAcceptance(e,t,n)}function u(e){return Promise.resolve()}function l(){return S}function m(){return P}function g(){var e=document.write,t=document.createElement("div");t.innerHTML=M.conversionPixels,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(t),setTimeout(function(){document.write=e},5e3)}function h(e,t){"GA"===e&&w(t)}function f(e){window.hasOwnProperty("GoogleAnalyticsObject")||function(e,t,n,o,i,r,a){e.GoogleAnalyticsObject=i,e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date,r=t.createElement(n),a=t.getElementsByTagName(n)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",a.parentNode.insertBefore(r,a)}(window,document,"script",0,"ga"),e.googleAnalyticsId&&window.ga("create",e.googleAnalyticsId,"auto"),window.ga("create","UA-28791515-1","auto",{name:"leadakiTracker"}),window.ga("leadakiTracker.set",{dimension1:"Pilar_1.0",dimension2:"Web_2.0",dimension3:e.chatbotName,dimension4:e.chatWindowTitle,dimension5:e.chatSaluteTimeInSeconds,dimension6:e.chatWindowColor});var t="/cliente/"+e.companyId+"\n /siteless/"+e.websiteId+"/"+encodeURIComponent(window.location.href);if(window.ga("send","pageview"),window.ga("leadakiTracker.send","pageview",t),e.googleAdWordsConversionId&&e.automaticRemarketingEnabled){var n="//googleads.g.doubleclick.net/pagead/viewthroughconversion/\n "+e.googleAdWordsConversionId+"/?value=0&guid=ON&script=0",o=document.createElement("img");o.src=n,o.height=1,o.width=1,o.style.borderStyle="none",o.style.display="none",console.log("Firing automatic Remarketing Pixel for Id "+e.googleAdWordsConversionId),document.body.appendChild(o)}N=!0}function w(e){N||f(M);var t=e.category,n=e.action,o=e.label,r=e.value;window.hasOwnProperty("gaq")&&window.gaq.push(["_trackEvent",t,n,o,r]),window.ga("leadakiTracker.send","event",t,n,o,r,{nonInteraction:!0}),window.ga("send","event",t,n,o,r,{nonInteraction:!0}),(window.ga.getAll?window.ga.getAll():[]).forEach(function(e){console.log(e.get("name"));var a=gaTrackers[i].get("name");a.startsWith("gtm")&&window.ga(a+".send","event",t,n,o,r)}),window.hasOwnProperty("dataLayer")&&window.dataLayer.push({event:t,action:n,label:o,value:r})}var p=n(3),y=o(p),I=n(2),v=o(I),T=n(1),C=n(0),b="https://stage.cliengo.com",k="/2.0/public/leads",U="https://s.cliengo.com/weboptimizer/",S="",P="",M="",_=void 0,A=void 0,N=!1;e.exports={createLead:c,validateIdentity:d,creditAcceptance:s,addFinnProfile:u,getSourceId:l,readAndSetCookies:a,getAccountId:m,trackEvent:h,init:r,fireNewLeadPixels:g}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cliengo=t():e.Cliengo=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";function o(e){this.accountId=e.companyId,this.sourceId=e.websiteId,this.whiteLabelId=e.whiteLabelId,this.googleAdWordsConversionId=e.googleAdWordsConversionId,this.googleAnalyticsId=e.googleAnalyticsId,this.chatbotName=e.chatbotName,this.phone=e.phone,this.conversionPixels=e.conversionPixels,this.chatWindowColor=e.chatWindowColor,this.chatWindowTitle=e.chatWindowTitle,this.chatWindowInputPlaceholder=e.chatWindowInputPlaceholder,this.chatInitialMessage=e.chatInitialMessage,this.chatIsWritingMessage=e.chatIsWritingMessage,this.chatSaluteTime=e.chatSaluteTimeInSeconds,this.formHooksEnabled=e.formHooksEnabled,this.contactBarEnabled=e.contactBarEnabled,this.automaticRemarketingEnabled=e.automaticRemarketingEnabled,this.poweredBy=e.poweredBy||{},this.hasConvertedLead=e.hasConvertedLead,this.WS_CHATBOT_URL=e.WS_CHATBOT_URL,this.sessionPath=e.sessionPath,this.debug=e.debug,this.lang=e.lang,this.widgetVersion=e.widgetVersion,this.customSettings=e.customSettings,this.url=e.url}o.prototype.getConvertionPixels=function(){return this.conversionPixels},e.exports={ChatConfig:o}},function(e,t,n){"use strict";function o(e){this.email=e.email,this.phone=e.phone,this.name=e.name,this.nationalIdentityNumber=e.nationalIdentityNumber,this.sourceId=e.sourceId,this.accountId=e.accountId,this.customFields=e.customFields||{},this.gender=e.gender,this.age=e.age,this.lastName=e.lastName,this.address=e.address||{country:null,zipCode:null,city:null,state:null},this.nationality=e.nationality,this.landingUrl=e.landingUrl,this.convertionUrl=e.convertionUrl,this.utmSource=null,this.utmMedium=null,this.utmCampaign=null,this.utmContent=null,this.utmTerm=null,this.utmAdgroup=null,this.gclid=null}o.prototype.addCustomField=function(e,t){this.customFields[e]=t},o.prototype.getCustomField=function(e){return this.customFields[e]},o.prototype.getEmail=function(){return this.email},o.prototype.getPhone=function(){return this.phone},o.prototype.getName=function(){return this.name},o.prototype.getSourceId=function(){return this.sourceId},o.prototype.getAccountId=function(){return this.accountId},o.prototype.getNationalIdentityNumber=function(){return this.nationalIdentityNumber};var i=Object.freeze({UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content",UTM_CAMPAIGN:"utm_campaign",UTM_ADGROUP:"utm_adgroup",GCLID:"gclid"});e.exports={Lead:o,UTMs:i}},function(e,t,n){"use strict";function o(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function i(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+60*n*1e3),o="; expires="+i.toGMTString()}return document.cookie=e+"="+t+o+NaN,e+"="+t+o+NaN}function r(e){var t=a(e);return t?"&"+e+"="+t:""}function a(e){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(window.location.search)||[,""])[1].replace(/\+/g,"%20"))||null}function c(e,t){return decodeURIComponent((new RegExp("[?|&]"+e+"=([^&;]+?)(&|#|;|$)").exec(t)||[,""])[1].replace(/\+/g,"%20"))||null}function s(){var e="";return e+=r("utm_source"),e+=r("utm_medium"),e+=r("utm_term"),e+=r("utm_content"),e+=r("utm_campaign"),e+=r("utm_adgroup"),e+=r("gclid"),i("ldkUtms",e,240),e}e.exports={readCookie:o,createCookie:i,addIfParameterExists:r,getURLParameter:a,getParamFromQueryString:c,setUtmCookies:s}},function(e,t,n){"use strict";function o(e,t){var n=c+s,o=JSON.stringify({leadId:e,sourceId:t}),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(n,r).then(function(e){return e.json()}).catch(function(e){return e})}function i(e,t,n){var o=c+d,i=JSON.stringify({leadId:e,sourceId:t,accountId:n}),r=new window.Headers,a={method:"POST",headers:r,mode:"cors",body:i,cache:"default"};return window.fetch(o,a).then(function(e){return e.json()})}function r(){var e=new window.Headers,t={method:"POST",headers:e,mode:"cors",cache:"default"};return window.fetch(c+u,t).then(function(e){return e.json()})}function a(e){var t=JSON.stringify({response:e}),n=new window.Headers,o={method:"POST",headers:n,mode:"cors",body:t,cache:"default"};return window.fetch(c+l,o).then(function(e){return e.json()}).catch(function(e){return e})}var c="https://fintech.cliengo.com",s="/mocks/veraz/AR/simpleValidation",d="/process/lead/UY",u="/mocks/veraz/AR/step1",l="/mocks/veraz/AR/step2";e.exports={validateIdentity:o,creditAcceptance:i,getSecurityQuestion:r,answerSecurityQuestion:a}},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return window.fetch(U+e+"/"+t+".js?configOnly=true").then(function(e){return e.json()}).then(function(e){if(window.leadakiSettings){h("GA",{category:"clgo_stats",action:"custom_settings"}),e.customSettings=window.leadakiSettings}return e.url=document.URL,M=new C.ChatConfig(e),S=M.sourceId,P=M.accountId,a(),e})}function a(){return null===v.default.readCookie("ldkRefererTracking")&&v.default.createCookie("ldkRefererTracking",document.referrer?document.referrer:"direct",240),v.default.setUtmCookies(),A=v.default.readCookie("ldkRefererTracking"),_=v.default.readCookie("ldkUtms"),!0}function c(e){var t=new T.Lead(e),n=v.default.readCookie("ldkUtms");t.accountId=P,t.sourceId=S,t.utmSource=v.default.getParamFromQueryString(T.UTMs.UTM_SOURCE,n)||"",t.utmMedium=v.default.getParamFromQueryString(T.UTMs.UTM_MEDIUM,n)||"",t.utmTerm=v.default.getParamFromQueryString(T.UTMs.UTM_TERM,n)||"",t.utmContent=v.default.getParamFromQueryString(T.UTMs.UTM_CONTENT,n)||"",t.utmCampaign=v.default.getParamFromQueryString(T.UTMs.UTM_CAMPAIGN,n)||"",t.utmAdgroup=v.default.getParamFromQueryString(T.UTMs.UTM_ADGROUP,n)||"",t.gclid=v.default.getParamFromQueryString(T.UTMs.GCLID,n)||"";var o=JSON.stringify(t),i=new window.Headers,r={method:"POST",headers:i,mode:"cors",body:o,cache:"default"};return window.fetch(b+k,r).then(function(e){return e.json()})}function s(e){return y.default.validateIdentity(e,l())}function d(e,t,n){return y.default.creditAcceptance(e,t,n)}function u(e){return Promise.resolve()}function l(){return S}function m(){return P}function g(){var e=document.write,t=document.createElement("div");t.innerHTML=M.conversionPixels,document.write=function(e){document.body.appendChild(e)},document.body.appendChild(t),setTimeout(function(){document.write=e},5e3)}function h(e,t){"GA"===e&&w(t)}function f(e){window.hasOwnProperty("GoogleAnalyticsObject")||(console.log("GoogleAnalyticsObject"),function(e,t,n,o,i,r,a){e.GoogleAnalyticsObject=i,e[i]=e[i]||function(){(e[i].q=e[i].q||[]).push(arguments)},e[i].l=1*new Date,r=t.createElement(n),a=t.getElementsByTagName(n)[0],r.async=1,r.src="//www.google-analytics.com/analytics.js",a.parentNode.insertBefore(r,a)}(window,document,"script",0,"ga")),e.googleAnalyticsId&&window.ga("create",e.googleAnalyticsId,"auto"),window.ga("create","UA-28791515-1","auto",{name:"leadakiTracker"}),window.ga("leadakiTracker.set",{dimension1:"Pilar_1.0",dimension2:"Web_2.0",dimension3:e.chatbotName,dimension4:e.chatWindowTitle,dimension5:e.chatSaluteTimeInSeconds,dimension6:e.chatWindowColor});var t="/cliente/"+e.companyId+"\n /siteless/"+e.websiteId+"/"+encodeURIComponent(window.location.href);if(window.ga("send","pageview"),window.ga("leadakiTracker.send","pageview",t),e.googleAdWordsConversionId&&e.automaticRemarketingEnabled){var n="//googleads.g.doubleclick.net/pagead/viewthroughconversion/\n "+e.googleAdWordsConversionId+"/?value=0&guid=ON&script=0",o=document.createElement("img");o.src=n,o.height=1,o.width=1,o.style.borderStyle="none",o.style.display="none",console.log("Firing automatic Remarketing Pixel for Id "+e.googleAdWordsConversionId),document.body.appendChild(o)}O=!0}function w(e){O||f(M);var t=e.category,n=e.action,o=e.label,r=e.value;window.hasOwnProperty("gaq")&&window.gaq.push(["_trackEvent",t,n,o,r]),window.ga("leadakiTracker.send","event",t,n,o,r,{nonInteraction:!0}),window.ga("send","event",t,n,o,r,{nonInteraction:!0}),(window.ga.getAll?window.ga.getAll():[]).forEach(function(e){console.log(e.get("name"));var a=gaTrackers[i].get("name");a.startsWith("gtm")&&window.ga(a+".send","event",t,n,o,r)}),window.hasOwnProperty("dataLayer")&&window.dataLayer.push({event:t,action:n,label:o,value:r})}var p=n(3),y=o(p),I=n(2),v=o(I),T=n(1),C=n(0),b="https://stage.cliengo.com",k="/2.0/public/leads",U="https://s.cliengo.com/weboptimizer/",S="",P="",M="",A=void 0,_=void 0,O=!1;e.exports={createLead:c,validateIdentity:s,creditAcceptance:d,addFinnProfile:u,getSourceId:l,readAndSetCookies:a,getAccountId:m,trackEvent:h,init:r,fireNewLeadPixels:g}}])}); | ||
//# sourceMappingURL=cliengo-sdk.min.js.map |
@@ -191,2 +191,3 @@ 'use strict'; | ||
if (!window.hasOwnProperty('GoogleAnalyticsObject')) { | ||
console.log('GoogleAnalyticsObject'); | ||
(function (i, s, o, g, r, a, m) { | ||
@@ -193,0 +194,0 @@ i.GoogleAnalyticsObject = r; |
{ | ||
"name": "cliengo-sdk", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "We offer a powerful Javascript API that gives you flexibility and config, control and track over the behavior of the Cliengo Platform. You can decide, how, when and where to display the chat box on your site, as well as view and update visitor information. You can also track informations and events in web platforms out of the box, including Google Analytics, Google Adwords, Facebook Ads and Google Tag Manager.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12286
575764