JezK
Edit File: analytics.min.js
(()=>{function w(e,o,t){var n=new Date,t=(n.setTime(n.getTime()+24*t*60*60*1e3),"expires="+n.toUTCString());document.cookie=e+"="+o+"; "+t+"; path=/"}function _(e){let o=e+"=";e=decodeURIComponent(document.cookie).split("; ");let t=[];return e.forEach(e=>{0===e.indexOf(o)&&(t=e.substring(o.length))}),t}jQuery(function(){(async()=>{if(cartflows&&""!==cartflows.current_step){let e=cartflows.current_flow,o=cartflows.current_step,t=cartflows.flow_cookie+e,n=cartflows.step_cookie+e,r=_(t);var f=(r=0<r.length?JSON.parse(decodeURIComponent(r)):r).includes(o);f||r.push(o),w(t,encodeURIComponent(JSON.stringify(r)),cartflows.analytics_cookie_expire_time);let c=cartflows?.analytics_base_url,i=(""!==c&&"null"!==c&&"/wp-json/cartflows-pro/v1/flow-analytics/"!==c||(p=window.location.pathname.split("/")[1]||"",p=window.location.origin+"/"+p+"/wp-json",c=p+"cartflows-pro/v1/flow-analytics/"),c),s=new URLSearchParams(window.location.search),a=[],l=(0<s.size&&s.forEach(function(e,o){a.push({name:o,value:e})}),_(n));var p={step_id:cartflows.current_step,flow_id:cartflows.current_flow,is_returning:f,flow_cookie_data:JSON.stringify(r),step_cookie_data:l,url_params:JSON.stringify(a)};try{fetch(i,{method:"POST",mode:"cors",cache:"no-cache",credentials:"omit",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer",body:JSON.stringify(p)}).then(e=>e.json()).then(e=>{var o;e.success&&(l=_(n),o=e.prev_control_id,l=0<l.length?JSON.parse(decodeURIComponent(l)):{},o&&l.hasOwnProperty(o)&&(l[o].conversion="yes",w(n,encodeURIComponent(JSON.stringify(l)),cartflows.analytics_cookie_expire_time)),l[cartflows.control_step]=JSON.parse(e.current_step_visit),w(n,encodeURIComponent(JSON.stringify(l)),cartflows.analytics_cookie_expire_time))})}catch(e){}}})()})})();