Skip to content

Commit

Permalink
Merge pull request #58 from privacy-scaling-explorations/42-insert-ma…
Browse files Browse the repository at this point in the history
…tomo-analytic-to-the-site

insert matomo analytics to the site
  • Loading branch information
thebeyondr authored Aug 8, 2023
2 parents 19e60f9 + eab3a78 commit 694ee24
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "@/styles/globals.css"
import { Metadata } from "next"
import Script from "next/script"

import { siteConfig } from "@/config/site"
import { fontDisplay, fontSans } from "@/lib/fonts"
Expand Down Expand Up @@ -39,9 +40,24 @@ export default function RootLayout({ children }: RootLayoutProps) {
className={`${fontSans.variable} ${fontDisplay.variable}`}
suppressHydrationWarning
>
<Script id="matomo-tracking" strategy="afterInteractive">
{`
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', '1']);
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);
})();
`}
</Script>
<head />
<body className={"min-h-screen bg-background antialiased"}>
<div className="relative flex min-h-screen flex-col">
<div className="relative flex flex-col min-h-screen">
<SiteHeader />
<div className="flex-1">{children}</div>
<SiteFooter />
Expand Down

1 comment on commit 694ee24

@vercel
Copy link

@vercel vercel bot commented on 694ee24 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.