Skip to content

Commit

Permalink
📈 Migrate analytics to Umami
Browse files Browse the repository at this point in the history
Replaced Vercel Analytics
  • Loading branch information
iqfareez committed Jan 29, 2025
1 parent 1b5ed7e commit c46dbd9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
9 changes: 7 additions & 2 deletions app/[locale]/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@/app/globals.css'
import { ThemeProvider } from "@/context/ThemeProvider";
import i18nConfig from '@/i18nConfig';
import { dir } from 'i18next';
import { Analytics } from '@vercel/analytics/react';
import Script from 'next/script'

const poppins = Poppins({ subsets: ["latin"], weight: ["400", "500", "600", "700"], display: "swap" });

Expand Down Expand Up @@ -32,7 +32,12 @@ export default function RootLayout({ children, params: { locale } }) {
<body className={poppins.className}>
<ThemeProvider attribute="class" enableSystem>
{children}
<Analytics />
{/* Umami Analytics Script */}
<Script
src="https://umami.iqfareez.com/script.js"
data-website-id="4834a0c6-b55f-4c72-9f5e-68d7b299ceea"
strategy="afterInteractive"
/>
</ThemeProvider>
</body>
</html>
Expand Down
4 changes: 4 additions & 0 deletions components/sections/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const Footer = () => {
href={item.href}
target="_blank"
className="text-gray-400 hover:text-gray-500"
data-umami-event="outbound-link-click"
data-umami-event-url={item.href}
>
<span className="sr-only">{item.name}</span>
<item.icon className="h-6 w-6" aria-hidden="true" />
Expand All @@ -59,6 +61,8 @@ const Footer = () => {
data-tooltip-content="👀"
data-tooltip-delay-show={800}
href="https://iqfareez.com"
data-umami-event="outbound-link-click"
data-umami-event-url="https://iqfareez.com"
>
Muhammad Fareez
</a>
Expand Down
4 changes: 4 additions & 0 deletions components/sections/HeroSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ const Hero = () => {
<a
className="sm:hidden block"
href="https://play.google.com/store/apps/details?id=live.iqfareez.waktusolatmalaysia&utm_source=waktusolat-site&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"
data-umami-event="outbound-link-click"
data-umami-event-url="https://play.google.com/store/apps/details?id=live.iqfareez.waktusolatmalaysia"
>
<Image
alt="Get it on Google Play"
Expand All @@ -122,6 +124,8 @@ const Hero = () => {
<a
href={"https://api.waktusolat.app"}
className=" flex-shrink-0 inline-flex items-center justify-center px-1 group"
data-umami-event="outbound-link-click"
data-umami-event-url="https://api.waktusolat.app"
>
<div className="text-slate-800 dark:text-slate-100 m-3.5 flex justify-center items-center group-hover:opacity-85">
<span>
Expand Down
23 changes: 5 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@mdx-js/react": "^3.0.0",
"@next/mdx": "^14.0.4",
"@types/mdx": "^2.0.10",
"@vercel/analytics": "^1.1.1",
"i18next": "^23.7.15",
"i18next-resources-to-backend": "^1.2.0",
"next": "14.0.4",
Expand Down

0 comments on commit c46dbd9

Please sign in to comment.