/* # Tracking Ver 1.0.0 # Tracking js # Copyright: (c) 2018-1019 weboo.io # Generated On: 2018-10-25 13:59:25 */ /* Supported Format : OK # (+11) 1111111111 # +111111111111 # +11 1111111111 # 11 1111 111 111 # (111)-1111-111 */ (function(w,d,n, p){ w._weboo = {'state':0x1, "cookie": "_webootracks", 'expire': 30} var ctype = { ORGANIC_GOOGLE: 0x1, ORGANIC_BING : 0x2, ORGANIC_FACEBOOK : 0x4, DIRECT : 0X8, GOOGLE_PPC : 0x10 } var _cookie=function(name, value, days) { var date, expires; if (days) { date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); expires = "; expires="+date.toGMTString(); } else { expires = ""; } d.cookie = name+"="+value+expires+"; path=/"; } var _escape = function(str) { return str.replace(/[-\/\^$*+?.()|[\]{}]/g, '\\$&'); } var _replace = function(e, n, n2) { for (e=e.firstChild;e;e=e.nextSibling){ nn = e.nodeName.toLowerCase(); if ( ['script', 'style', 'noscript'].indexOf(nn)>=0) continue if ( e.nodeType ==3){ if ( e.nodeValue.match(new RegExp(_escape(n),"ig"))) { e.nodeValue = e.nodeValue.replace(new RegExp(_escape(n),"ig"), n2) if (e.parentNode && e.parentNode.nodeType==1 && ['a'].indexOf(e.parentNode.nodeName.toLowerCase())!=-1 && e.parentNode.getAttribute('href')) { href = e.parentNode.getAttribute('href').replace(/([a-z]{1,}:)(.*)/ig,"$1" + n2.replace(/[^0-9]/ig, "") );e.parentNode.setAttribute('href', href); } } } else _replace(e, n, n2) } } this.init = function() { console.log(w._weboo.state) c_u = w.location.toString() r_u = d.referrer //r_u = 'https://bing.com' r_d = null if (r_u){ a = d.createElement('a'); a.href = r_u; r_d = a.hostname } if ( w._weboo.state & 0x2 || w._weboo.state & 0x4) return w._weboo.state = 0x2 var re = new RegExp('[; ]'+w._weboo['cookie']+'=([^\s;]*)'); var c = (' '+d.cookie).match(re); w._weboo['cs'] = ctype.DIRECT if (c) w._weboo['cs'] = parseInt(c[1]) if (!(w._weboo['cs'] & ctype['ORGANIC_GOOGLE']) && r_d && r_d.match(/google/i)) { w._weboo['cs'] = ctype.ORGANIC_GOOGLE } if (!(w._weboo['cs'] & ctype['ORGANIC_BING']) && r_d && r_d.match(/bing/i)) { w._weboo['cs'] = ctype.ORGANIC_BING } if (!(w._weboo['cs'] & ctype['ORGANIC_FACEBOOK']) && r_d && r_d.match(/facebook/i)) { w._weboo['cs'] = ctype.ORGANIC_FACEBOOK } if (!(w._weboo['cs'] & ctype['GOOGLE_PPC']) && r_d && r_d.match(/google/i) && c_u && c_u.match(/gclid=/i)) { w._weboo['cs'] = ctype.GOOGLE_PPC } rp = null for(var cp in p ) { cd = p[cp] if ( w._weboo['cs'] & cd['type']) { rp = cd['val'] break } } if (rp) _replace(d.body, n, rp) _cookie(w._weboo['cookie'], w._weboo['cs'], w._weboo['expires']) w._weboo.state = 0x4 } if (d.addEventListener) { d.addEventListener("DOMContentLoaded", this.init, false); d.addEventListener("readystatechange", this.init, false); w.addEventListener("load", this.init, false); } else if (document.attachEvent) { d.attachEvent("onreadystatechange", this.init); w.attachEvent("onload", this.init); } })(window,document,"(907) 344-5633", [{"type":8,"val":"(907) 344-5633"},{"type":0,"val":"(877) 688-0728"}]);