var pageUrl = window.location.pathname, firstIndex = pageUrl.indexOf('/'), lastIndex = pageUrl.lastIndexOf('/'), eventId = pageUrl.substring(firstIndex + 7, lastIndex); var cookie_name = 'cvt_cookie_consent-' + eventId; var getItem = localStorage.getItem(cookie_name); var get_consent = JSON.parse(getItem); if (get_consent != null && get_consent.Marketing === true) { executeCodeBizible(); } function ynb(ev) { if (ev.target.className === 'cc-btn cc-dismiss') { executeCodeBizible(); } } document.addEventListener('click', ynb, false); function executeCodeBizible() { addScript('https://cdn.bizible.com/scripts/bizible.js'); window['Bizible'] = window['Bizible'] || { _queue: [], Push: function (o, p) { this._queue.push({ type: o, data: p }); } }; function fnb(ev) { if (ev.target.id === 'complete') { var reportData = {}; var get_email = localStorage.getItem("evt_email"); var emEle = document.getElementById("ff919d05-4281-4d9c-aa0d-82e3722d580d"); if (emEle) { email = emEle.value; if (email) { Bizible.Push('User', { eMail: email }); reportData['FormSubmit'] = "FormSubmitted"; Bizible.Push('Event', reportData); } } if (get_email) { Bizible.Push('User', { eMail: get_email }); reportData['FormSubmit'] = "FormSubmitted"; Bizible.Push('Event', reportData); localStorage.removeItem("evt_email"); } } } document.addEventListener('click', fnb, false); function znb(ev) { var get_emailnext = localStorage.getItem("evt_email"); if (ev.target.id === 'forward' && !get_emailnext) { var emEle = document.getElementById("ff919d05-4281-4d9c-aa0d-82e3722d580d"); if (emEle) { email = emEle.value; if (email) { localStorage.setItem("evt_email", email); } } } } document.addEventListener('click', znb, false); } function addScript(src) { var s = document.createElement('script'); s.setAttribute('src', src); s.setAttribute('async', 'async'); document.head.appendChild(s); }