301//PROLONGATE COOKIE EXPIRATION302if (!isCookieDisabled) {303var expiriesDate = 60 * 60 * 24 * 90; //90 days in seconds304t_stat__setCookie('tildauid', userid, { expires: expiriesDate, path: '/' });305t_stat__setCookie('tildasid', sessionid, { expires: 1800, path: '/' });306}307}308309function create(opts) {310//CHECK BOTS311if (statParams.user_agent > '' && statParams.user_agent.indexOf('bot') != -1) {312
return false; } if (window.location.protocol != 'http:' && window.location.protocol != 'https:') { console.log('TildaStat: cannot work on local page'); return false; } //GET UID AND SID t_stat__getUIDandSID(); t_stat__setUIDandSID(); statParams.page = t_stat__getPageURL(); statParams.referrer = document.referrer || ''; statParams.userid = userid; statParams.sessionid = sessionid; statParams.user_agent = window.navigator.userAgent; statParams.user_language = window.navigator.userLanguage || window.navigator.language; if (allRec) { statParams.projectid = allRec.getAttribute('data-tilda-project-id') || '0'; statParams.pageid = allRec.getAttribute('data-tilda-page-id') || '0'; statParams.pagealias = allRec.getAttribute('data-tilda-page-alias') || ''; statParams.formskey = allRec.getAttribute('data-tilda-formskey') || ''; } statParams.params = {}; var tmp; //UTM try { tmp = decodeURIComponent(window.location.search); } catch (e) { tmp = window.location.search; } if (tmp > '?') { statParams.pagequery = tmp.substring(1).toLowerCase(); if (~statParams.pagequery.indexOf('utm_')) { var arPair; var arParams = statParams.pagequery.split('&'); Array.prototype.forEach.call(arParams, function (param) { arPair = param.split('='); if (arPair.length > 1) { if ( arPair[0] === 'utm_referrer' && (!statParams.referrer || ~statParams.referrer.indexOf('ohio8.v')) ) { statParams.referrer = arPair[1]; } else { statParams.params[arPair[0]] = arPair[1]; } } else { statParams.params[arPair[0]] = ''; } }); } } //IS MOBILE var isMobile = false; if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { isMobile = true; } statParams.ismobile = isMobile; //KEY (CODE) if (document.getElementById('tildastatscript')) { statParams.tildastatcode = document.getElementById('tildastatscript').key; } //SCROLL STAT if (isScrollTrack) { try { t_stat__onVisibilityWindowChange(function (visible) { isWindowActive = !!visible; }); document.body.addEventListener( 'mousewheel', t_throttle(function () { isWindowActive = true; }, 1000) ); document.body.addEventListener( 'mousemove', t_throttle(function () { isWindowActive = true; }, 1000) );