This commit is contained in:
2024-04-01 14:17:44 +05:00
parent bc515a577c
commit b61cb76cc3
2 changed files with 35 additions and 8 deletions
+1
View File
@@ -1,5 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
trailingSlash: true,
distDir: "dist",
};
+34 -8
View File
@@ -4,6 +4,7 @@ import { Suspense } from "react";
import { Inter } from "next/font/google";
import YandexMetrika from "@components/YandexMetrika";
import "./globals.css";
import Head from "next/head";
const inter = Inter({ subsets: ["cyrillic", "latin"] });
@@ -19,15 +20,40 @@ export default function RootLayout({
return (
<html lang="ru">
<body className={inter.className}>
<Script
id="metrika-counter"
strategy="afterInteractive"
src="./ym.js"
></Script>
<Suspense fallback={<></>}>
<YandexMetrika />
</Suspense>
<main>{children}</main>
<Script id="metrika-counter" strategy="afterInteractive">
{`(function (m, e, t, r, i, k, a) {
m[i] =
m[i] ||
function () {
(m[i].a = m[i].a || []).push(arguments);
};
m[i].l = 1 * new Date();
for (var j = 0; j < document.scripts.length; j++) {
if (document.scripts[j].src === r) {
return;
}
}
(k = e.createElement(t)),
(a = e.getElementsByTagName(t)[0]),
(k.async = 1),
(k.src = r),
a.parentNode.insertBefore(k, a);
})(
window,
document,
"script",
"https://mc.yandex.ru/metrika/tag.js",
"ym"
);
ym(93606080, "init", {
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true,
});`}
</Script>
</body>
</html>
);