Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 846c066314 |
@@ -70,7 +70,7 @@
|
||||
{# Футер #}<footer class="footer mt-auto py-2 mt-4">
|
||||
<div class="container d-flex justify-content-between align-items-center">
|
||||
<span class="text-muted small nowrap me-2">© Sergei Erjemin, 2025–{% now 'Y' %}.</span>
|
||||
<nobr class="text-muted small mx-2"><i class="bi bi-tags me-1" title="Версия библиотеки etpgrf / Версия сайта"></i>v0.1.3 / v0.1.6
|
||||
<nobr class="text-muted small mx-2"><i class="bi bi-tags me-1" title="Версия библиотеки etpgrf / Версия сайта"></i>v0.1.3 / v0.1.8
|
||||
</nobr>
|
||||
{# Сводная статистика (HTMX) #}<span class="text-muted small ms-2" hx-get="{% url 'stats_summary' %}" hx-trigger="load">
|
||||
...
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
// Слушать изменения
|
||||
darkModeMediaQuery.addEventListener('change', updateTheme);
|
||||
|
||||
|
||||
// --- ЛОГОТИП И СКРОЛЛ ---
|
||||
function updateLogo() {
|
||||
const navbar = document.getElementById('logo');
|
||||
@@ -30,17 +29,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Инициализация логотипа при загрузке и скролле
|
||||
// document.addEventListener('DOMContentLoaded', updateLogo);
|
||||
window.addEventListener('scroll', updateLogo, { passive: true });
|
||||
|
||||
|
||||
// --- КУКИ И СЧЕТЧИКИ ---
|
||||
const COOKIE_KEY = 'cookie_consent';
|
||||
const TTL_MS = 90 * 24 * 60 * 60 * 1000; // 90 дней
|
||||
const MAILRU_ID = "3734603";
|
||||
const YANDEX_ID = "106310834";
|
||||
const GOOGLE_ID = "G-03WY2S9FXB";
|
||||
|
||||
function loadCounters() {
|
||||
// console.log("Загрузка счетчиков...");
|
||||
@@ -67,6 +64,22 @@
|
||||
trackLinks:true,
|
||||
accurateTrackBounce:true
|
||||
});
|
||||
|
||||
// Google Analytics
|
||||
(function() {
|
||||
var script = document.createElement('script');
|
||||
script.async = true;
|
||||
script.src = 'https://www.googletagmanager.com/gtag/js?id=' + GOOGLE_ID;
|
||||
document.head.appendChild(script);
|
||||
})();
|
||||
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
// Делаем gtag глобальной, чтобы вызывать из sendGoal
|
||||
window.gtag = gtag;
|
||||
gtag('js', new Date());
|
||||
gtag('config', GOOGLE_ID);
|
||||
|
||||
} catch (e) {
|
||||
console.error("Ошибка загрузки счетчиков:", e);
|
||||
}
|
||||
@@ -115,12 +128,18 @@
|
||||
// console.log("Sending goal:", goalName);
|
||||
|
||||
try {
|
||||
// Mail.ru
|
||||
if (window._tmr) {
|
||||
window._tmr.push({ id: MAILRU_ID, type: "reachGoal", goal: goalName, value: 1 });
|
||||
}
|
||||
// Яндекс.Метрика
|
||||
if (typeof window.ym === 'function') {
|
||||
window.ym(YANDEX_ID, 'reachGoal', goalName);
|
||||
}
|
||||
// Google Analytics
|
||||
if (typeof window.gtag === 'function') {
|
||||
window.gtag('event', goalName);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Ошибка отправки цели:", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user