Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-stat-1.0.js

Код файла
Версия от 04.12.2026, 04:03:52 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
401				document.body.addEventListener(402					'keypress',403					t_throttle(function () {404						isWindowActive = true;405					}, 1000)406				);407				document.body.addEventListener(408					'click',409					t_throttle(function () {410						isWindowActive = true;411					}, 1000)412				);413
История файла и сравнение версий
  • 04.12.2026, 04:03:52 · 56c3b845
} catch (e) {
414 /* */
415 }
416 }
417
418 //FINGERPRINT
419 statParams.fingerprint = t_stat__getFingerPrint();
420
421 //FLAG inited
422 isInited = true;
423 }
424
425 function t_stat__pageView(opts) {
426 var staturl = 'https://stat.tildaapi.' + t_stat__getRootZone() + '/event/';
427 if (!isCookieDisabled) {
428 //RECREATE COOKIE
429 var sessid = t_stat__getCookie('tildasid') || '';
430 if (sessid != statParams.sessionid) {
431 t_stat__setCookie('tildasid', statParams.sessionid, { expires: 1800, path: '/' });
432 }
433 }
434
435 //get previous url
436 if (statParams.referrer === '') {
437 statParams.referrer = t_stat__getCookie('previousUrl') || '';
438 }
439
440 statParams.tildautm = t_stat__getCookie('TILDAUTM') || '';
441
442 if (!statParams.page) {
443 console.log('TildaStat: page empty');
444 statParams.page = t_stat__getPageURL();
445
446 if (window.location.hash && window.location.hash.indexOf('#!') === 0) {
447 statParams.page += window.location.hash;
448 }
449 }
450
451 //for events like /tilda/readtime/ adding domain
452 if (statParams.page.substring(0, 1) === '/') {
453 statParams.page = window.location.hostname + statParams.page;
454 }
455
456 var encodingStat = t_stat__endcodeObj(statParams);
457
458 var currentPage = t_stat__getPageURL();
459 if (allRec && (statParams.page === currentPage || statParams.page === currentPage + window.location.hash)) {
460 var postUid = allRec.getAttribute('data-tilda-post-uid');
461 var productUid = allRec.getAttribute('data-product-uid');
462 if (!postUid && !productUid) {
463 // каталог 1.2 с фолбэком на 1.1; пустой data-product-uid пропускаем
464 var productSnippet = document.querySelector(
465 '.t-catalog__product-snippet[data-product-uid]:not([data-product-uid=""]),' +
466 '.t-store__product-snippet[data-product-uid]:not([data-product-uid=""])'
467 );
468 productUid = productSnippet && productSnippet.getAttribute('data-product-uid');
469 }
470 if (postUid) {
471 encodingStat += '&postuid=' + encodeURIComponent(postUid);
472 } else if (productUid) {
473 encodingStat += '&productuid=' + encodeURIComponent(productUid);
474 }
475 }
476
477 var xhr = new XMLHttpRequest();
478 xhr.open('POST', staturl, true);
479 xhr.withCredentials = false;
480 // xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
481 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
482
483 xhr.onerror = function (data) {
484 console.error('TildaStat: fail pageview ');
485
486 console.error(data);
487 };
488 xhr.timeout = 3000;
489 xhr.send(encodingStat);
490
491 if (
492 statParams.page &&
493 statParams.page.indexOf('tilda/scroll') === -1 &&
494 statParams.page.indexOf('tilda/readtime') === -1 &&
495 statParams.page.indexOf('tilda/click') === -1 &&
496 statParams.page.indexOf('tilda/cookieenabled') === -1
497 ) {
498 statParams.referrer = statParams.page;
499 if (!isCookieDisabled) {
500 t_stat__setCookie('previousUrl', statParams.page, { path: '/', expires: 1800 });
Предыдущие 100 строкСледующие 100 строк