(function() { var take = function() { //DDP const chatform_upsell = localStorage.getItem("chatform_upsell") let path = window.location.pathname; // if(chatform_upsell && path.includes("lp/cv_confirm")){ console.log("working click") // setTimeout(() => { // document.querySelector('input#submit').click() // }, 2000); // } if(chatform_upsell && path.includes('/lp/complete')){ console.log("cv_upsel complete") var url = "https://pr.aqur.com/track"; function track(trackingData) { fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: trackingData }) .then(response => response.json()) .then(data => { console.log("Upsell Conversion Tracked!!") localStorage.removeItem("chatform_upsell") }) } track(chatform_upsell) } } setTimeout(take, 0); }())