window.sE_getCookie_N = function sE_getCookie_N(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } setTimeout(function () { var nsurl = 'https://smartengage.com/webhook/pagevisitag?broadcast_id=0&track_id=0&url=&sub_id=' + sE_getCookie_N('subscriber_id'); console.log(nsurl); var xmlhttp; // compatible with IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { } } xmlhttp.open("GET", nsurl, true); xmlhttp.send(); }, 1000); function receiveMessageOutside(event) { if (event.origin.indexOf('smartengage.com') > 0) { try { if (event.data.indexOf('postDataAfterSuccess') >= 0) { console.log(event); var response = JSON.parse(event.data); if (response['status'] == 1) { jQuery('.sE_success').html(response['msg']); jQuery('.sE_success').show(); //hide chicklet sE_setCookie('sE_PUSH_DENY', '', 1); jQuery(document.body).find('.sE_chicklet_bX').html(''); setTimeout(function () { if (response['after_submit'] != "") location.href = response['after_submit'] jQuery("#se_PH_mDl_fb_connect" + response['id']).hide(); }, 2500); } else { jQuery('.sE_error').html(response['msg']); jQuery('.sE_error').show(); } return; } } catch (err) {} } } window.addEventListener("message", receiveMessageOutside, false); function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)); var sURLVariables = sPageURL.split('&'); var sParameterName; var i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } } function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } function in_array(needle, haystack) { for (var i in haystack) { if (haystack[i] == needle) { return true; } } return false; } window.sE_setCookie_N = function sE_setCookie_N(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; console.log('savedcookie') } window.sE_getCookie_N = function sE_getCookie_N(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } if (getUrlParameter('seref')) { var seAllRef = atob(getUrlParameter('seref')); var regex1 = '(?:^|[?&])b=([^&]*)'; var match1 = seAllRef.match(regex1); } var broad = (match1 && match1.length > 1) ? match1[1] : ''; if (broad) { sE_setCookie_N('sE_BCST', broad, 365); sE_setCookie_N('sE_ATMN', '', 365); } if (getUrlParameter('seref')) { var regex2 = '(?:^|[?&])t=([^&]*)'; var match2 = seAllRef.match(regex2); } var ty = (match2 && match2.length > 1) ? match2[1] : ''; if (ty) { sE_setCookie_N('sE_TPE', ty, 365); } if (getUrlParameter('seref')) { var regex3 = '(?:^|[?&])su=([^&]*)'; var match3 = seAllRef.match(regex3); } var s = (match3 && match3.length > 1) ? match3[1] : ''; if (s) { sE_setCookie_N('subscriber_id', s, 365 * 10); } if (getUrlParameter('seref')) { var regex4 = '(?:^|[?&])a=([^&]*)'; var match4 = seAllRef.match(regex4); } var auto = (match4 && match4.length > 1) ? match4[1] : ''; if (auto) { sE_setCookie_N('sE_ATMN', auto, 365); sE_setCookie_N('sE_BCST', '', 365); } if (getUrlParameter('seref')) { var regex5 = '(?:^|[?&])tid=([^&]*)'; var match5 = seAllRef.match(regex5); } var tid = (match5 && match5.length > 1) ? match5[1] : ''; if (tid) { sE_setCookie_N('sE_TID', tid, 365); } var conversion_called = false; window.sE_removeParams = function sE_removeParams(sParam) { var url = window.location.href.split('?')[0] + '?'; var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] != sParam) { url = url + sParameterName[0] + '=' + sParameterName[1] + '&' } } window.history.pushState("", "", url.substring(0, url.length - 1)); } if (getUrlParameter('utm_source')) { sE_removeParams('utm_source'); } if (getUrlParameter('utm_campaign')) { sE_removeParams('utm_campaign'); } if (getUrlParameter('seref')) { sE_removeParams('seref'); } window['_smartconversion'] = {}; window.sE_conSetCookie = function sE_conSetCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } window.sE_conGetCookie = function sE_conGetCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } window['_smartconversion']['track'] = function (cdata) { jQuery.ajax({ type: "POST", url: 'https://tag.smartengage.com/.js', cache: false, crossDomain: true, data: { 'track': cdata, broadcast: sE_conGetCookie('sE_BCST'), typ: sE_conGetCookie('sE_TPE'), push_cookie_sub_id: sE_conGetCookie('subscriber_id'), auto: sE_conGetCookie('sE_ATMN'), tid: sE_conGetCookie('sE_TID') }, dataType: 'json', xhrFields: {withCredentials: true}, success: function (data) { } }); if (typeof window['smartuser'] !== 'undefined') { jQuery.ajax({ type: "POST", url: 'https://smartengage.com/webhook/kajabi/', cache: false, crossDomain: true, data: window['smartuser'], dataType: 'json', xhrFields: {withCredentials: true}, success: function (data) { } }); } }; window._doPostBack = function _doPostBack(data) { alert('myda'); } if (typeof (jQuery) == 'undefined') { var dc = document.createElement('script'); dc.type = 'text/javascript'; dc.src = '//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'; document.getElementsByTagName('head')[0].appendChild(dc); setTimeout(function () { // window['_smartconversion']['track']({'track_url': window.location.pathname}); window['_smartconversion']['track']({'track_url': window.location.href}); }, 1000); } else { setTimeout(function () { // window['_smartconversion']['track']({'track_url': window.location.pathname}); window['_smartconversion']['track']({'track_url': window.location.href}); }, 1000); } var dc = document.createElement('link'); dc.rel = 'manifest'; dc.href = 'https://smartengage.com/push/manifest.json'; document.getElementsByTagName('head')[0].appendChild(dc);