Get Demo

Contact us

(function () { var url = "http://phonewagonapp-test.us-west-2.elasticbeanstalk.com/api/DynamicNumbers/DNI"; var url2 = "http://phonewagonapp-test.us-west-2.elasticbeanstalk.com/api/DynamicNumbers/DNIUpdate"; var _swapTo = ""; var _swapWith = ""; var _cookieDNGUID = "pw_dns_DniGUID_" + '3b19a59f-5114-e711-b79d-0299df50c115'; var _cookieSwapTo = "pw_dns_SwapTo"; var _cookieSwapWith = "pw_dns_SwapWith"; var _cookieReferrer = "_cookieReferrer"; var _hostName = document.location.hostname; var _delayTimeToUpdateNumber = 100000; function getReferrerHost(e, t) { var a; return a = e.match(/^(.*)doubleclick(.*)$/) || t.match(/^(.*)gclid=(.*)$/) ? "google_paid" : e.match(/^(.*)google(.*)$/) && !e.match(/^(.*)mail\.google\.com(.*)$/) ? e.match(/^(.*)maps\.google\.[a-z\.]{2,5}(.*)$/) ? "google_local" : e.match(/google\.[a-z\.]{2,5}\/(aclk|afs)/) || e.match(/googleadservices/) || t.match(/utm_(medium|source)=[cp]pc/i) || t.match(/(matchtype|adposition)=/i) ? "google_paid" : "google_organic" : e.match(/^(.*)yahoo(.*)$/) && !e.match(/^(.*)mail\.yahoo\.com(.*)$/) ? e.match(/^(.*)local\.yahoo\.com(.*)$/) || e.match(/^(.*)local\.search\.yahoo\.com(.*)$/) ? "yahoo_local" : t.match(/^(.*)utm_medium=cpc(.*)$/i) || t.match(/^(.*)utm_medium=ppc(.*)$/i) ? "yahoo_paid" : "yahoo_organic" : e.match(/^(.*){1}(\/|\.)bing\.(.*)$/) ? e.match(/^(.*)bing\.com\/local(.*)$/) ? "bing_local" : t.match(/utm_medium=cpc/i) || t.match(/utm_medium=ppc/i) || t.match(/utm_source=bing/i) ? "bing_paid" : "bing_organic" : e.match(/^(.*)msn\.com(.*)$/) ? "bing_paid" : "direct" == e ? t.match(/^(.*)utm_medium=[cp]pc(.*)$/i) && t.match(/^(.*)utm_source=google(.*)$/i) ? "google_paid" : "direct" : getReferrerDomain(e) }; function getReferrerDomain(e) { if (e == "") return "direct"; var t = e.split("/")[2], a = t.split("."), r = t; return a.length > 2 && (r = a[a.length - 2] + "." + a[a.length - 1]), r }; var cookieRef = getCookie(_cookieReferrer); if (cookieRef == "" || cookieRef == undefined || cookieRef == null) { setCookie(_cookieReferrer, getReferrerHost(document.referrer, document.URL), 30); } var data = { CGUID: '3b19a59f-5114-e711-b79d-0299df50c115', Host: getCookie(_cookieReferrer), OperatingSystem: getOS(), Browser: getBrowser() }; var cookieValue = getCookie(_cookieDNGUID); if (cookieValue == "" || cookieValue == undefined || cookieValue == null) { $.ajax({ url: url, type: 'POST', dataType: 'json', data: data, success: function (data) { setCookie(_cookieDNGUID, data.DNIGUID, 30); setCookie(_cookieSwapTo, data.SwapTo, 30); setCookie(_cookieSwapWith, '410-726-3087', 30); _swapWith = new RegExp('410-726-3087', 'g'); _swapTo = data.SwapTo; swapNumbers(document.body); setInterval(function () { swapAfterDelay(); }, _delayTimeToUpdateNumber); }, error: function (error) { console.log(error); } }); } else { swapAfterDelay(); setInterval(function () { swapAfterDelay(); }, _delayTimeToUpdateNumber); } function getOS() { var OSName = "Unknown OS"; if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows"; if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS"; if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX"; if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux"; return OSName; }; function getBrowser() { var ua = navigator.userAgent, tem, M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if (/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return 'IE ' + (tem[1] || ''); } if (M[1] === 'Chrome') { tem = ua.match(/\b(OPR|Edge)\/(\d+)/); if (tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera'); } M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?']; if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]); return M.join(' '); }; function swapAfterDelay() { var cookieValue = getCookie(_cookieDNGUID); if (cookieValue !== "" || cookieValue !== undefined || cookieValue !== null) { var dataToPass = { DNIGUID: cookieValue, Host: getCookie(_cookieReferrer), OperatingSystem: getOS(), Browser: getBrowser() }; $.ajax({ url: url2, type: 'POST', dataType: 'json', data: dataToPass, success: function (data) { var swapWith = getCookie(_cookieSwapWith); var swapTo = getCookie(_cookieSwapTo); _swapWith = new RegExp(swapWith, 'g'); _swapTo = swapTo; swapNumbers(document.body) }, error: function (error) { errorFunc(error); } }); } } function setCookie(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=/"; } function getCookie(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 ""; } function swapNumbers(node) { if (node.nodeType == 3) { node.data = node.data.replace(_swapWith, _swapTo); } if (node.nodeType == 1 && node.nodeName != "SCRIPT") { for (var i = 0; i < node.childNodes.length; i++) { swapNumbers(node.childNodes[i]); } } }})(window);