diff --git a/app/[locale]/blog/[slug]/page.tsx b/app/[locale]/blog/[slug]/page.tsx index 7c4e6eca..5cc8739f 100644 --- a/app/[locale]/blog/[slug]/page.tsx +++ b/app/[locale]/blog/[slug]/page.tsx @@ -11,6 +11,7 @@ import TableOfContents from '@/components/blog/TableOfContents'; import { mdxComponents } from '@/components/blog/MDXComponents'; import { Heading } from '@/components/ui'; import { setRequestLocale } from 'next-intl/server'; +import BlogEngagementTracker from '@/components/analytics/BlogEngagementTracker'; interface BlogPostProps { params: Promise<{ @@ -67,6 +68,12 @@ export default async function BlogPost({ params }: BlogPostProps) { return (
+ {/* Featured Image Header */} {post.frontmatter.featuredImage ? (
diff --git a/app/[locale]/not-found.tsx b/app/[locale]/not-found.tsx index ed0d56c9..f2bb9a93 100644 --- a/app/[locale]/not-found.tsx +++ b/app/[locale]/not-found.tsx @@ -1,9 +1,20 @@ import { useTranslations } from 'next-intl'; import { Container, Button, Heading } from '@/components/ui'; import Scribble from '@/components/Scribble'; +import { useEffect } from 'react'; +import { useAnalytics } from '@/components/analytics/useAnalytics'; +import { AnalyticsEvents } from '@/components/analytics/analytics-events'; export default function NotFound() { const t = useTranslations('Error.notFound'); + const { trackEvent } = useAnalytics(); + + useEffect(() => { + trackEvent(AnalyticsEvents.ERROR, { + type: '404_not_found', + path: typeof window !== 'undefined' ? window.location.pathname : 'unknown', + }); + }, [trackEvent]); return ( @@ -16,19 +27,17 @@ export default function NotFound() { 404 -
{t('title')} - -

- {t('description')} -

+ +

{t('description')}