From 3a1f0782fcdbb446c8806370f8e8623ec0e68706 Mon Sep 17 00:00:00 2001 From: cedoor Date: Thu, 8 Feb 2024 16:39:26 +0000 Subject: [PATCH] chore: add matomo script for cookies --- apps/docs/docusaurus.config.ts | 25 +++++++++++++++++++++++++ apps/website/src/app/layout.tsx | 17 +++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/apps/docs/docusaurus.config.ts b/apps/docs/docusaurus.config.ts index bf05b057f..7773fa946 100644 --- a/apps/docs/docusaurus.config.ts +++ b/apps/docs/docusaurus.config.ts @@ -21,6 +21,31 @@ const config: Config = { defaultLocale: "en", locales: ["en", "es"] }, + headTags: [ + { + tagName: "link", + attributes: { + rel: "preconnect", + href: "https://psedev.matomo.cloud" + } + }, + { + tagName: "script", + innerHTML: ` + var _paq = window._paq = window._paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="https://psedev.matomo.cloud/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '10']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src='//cdn.matomo.cloud/psedev.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s); + })(); + ` + } + ], presets: [ [ "classic", diff --git a/apps/website/src/app/layout.tsx b/apps/website/src/app/layout.tsx index c33570cbb..06221cbff 100644 --- a/apps/website/src/app/layout.tsx +++ b/apps/website/src/app/layout.tsx @@ -1,5 +1,6 @@ import { Box, Container } from "@chakra-ui/react" import type { Metadata } from "next" +import Script from "next/script" import Footer from "../components/Footer" import Navbar from "../components/Navbar" import Providers from "./providers" @@ -37,6 +38,22 @@ export default function RootLayout({ children }: { children: React.ReactNode }) + + ) }