Skip to content

Commit

Permalink
Merge pull request #90 from VoiceDeck/feat/analytics
Browse files Browse the repository at this point in the history
feat(analytics): 🔍 Add Matomo tracking script to layout component
  • Loading branch information
thebeyondr authored Apr 9, 2024
2 parents 32a70c3 + c723ec7 commit 111df3b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { siteConfig } from "@/config/site";
import { config } from "@/config/wagmi";
import { WagmiContextProvider } from "@/contexts/wagmi";
import { headers } from "next/headers";
import Script from "next/script";

export const metadata: Metadata = {
metadataBase: new URL("https://app.voicedeck.org/"),
Expand Down Expand Up @@ -57,6 +58,26 @@ export default function RootLayout({
<div className="flex-1">{children}</div>
<Footer />
</WagmiContextProvider>
<Script
id="matomo-tracking"
strategy="afterInteractive"
// biome-ignore lint/security/noDangerouslySetInnerHtml: <explanation>
dangerouslySetInnerHTML={{
__html: `
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://psedev.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '13']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://cdn.matomo.cloud/psedev.matomo.cloud/matomo.js';
s.parentNode.insertBefore(g,s);
})();
`,
}}
/>
</body>
</html>
);
Expand Down

0 comments on commit 111df3b

Please sign in to comment.