Add PostHog analytics — full event tracking across all pages
Tracks pageviews, hero/CTA clicks, product teaser clicks, app card and detail views, newsletter signups, nav interactions, and footer link clicks with structured properties for PostHog dashboards. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
36
app/page.tsx
36
app/page.tsx
@@ -1,6 +1,9 @@
|
||||
'use client'
|
||||
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import NewsletterForm from '@/components/ui/NewsletterForm'
|
||||
import { posthog } from '@/lib/posthog'
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
@@ -21,11 +24,19 @@ export default function HomePage() {
|
||||
Handgemachte Stücke und sanfte Rituale für ein Zuhause, das zur Ruhe einlädt. Wir feiern das Langsame, das Echte, das Wesentliche.
|
||||
</p>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 22 }}>
|
||||
<Link href="/shop" style={{ textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 11, background: '#C4896A', color: '#FAFAF7', fontSize: 15.5, fontWeight: 600, letterSpacing: 0.3, padding: '16px 32px', borderRadius: 44 }}>
|
||||
<Link
|
||||
href="/shop"
|
||||
onClick={() => posthog.capture('hero_cta_clicked', { destination: '/shop', label: 'Entdecken' })}
|
||||
style={{ textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 11, background: '#C4896A', color: '#FAFAF7', fontSize: 15.5, fontWeight: 600, letterSpacing: 0.3, padding: '16px 32px', borderRadius: 44 }}
|
||||
>
|
||||
Entdecken
|
||||
<span style={{ display: 'inline-block', width: 18, height: 18, borderRadius: '50%', border: '1.5px solid rgba(250,250,247,0.6)' }} />
|
||||
</Link>
|
||||
<Link href="/#ueber" style={{ textDecoration: 'none', fontSize: 15, fontWeight: 600, color: '#3D2B1F', borderBottom: '1.5px solid #A8B89A', paddingBottom: 3 }}>
|
||||
<Link
|
||||
href="/#ueber"
|
||||
onClick={() => posthog.capture('hero_cta_clicked', { destination: '/#ueber', label: 'Unsere Geschichte' })}
|
||||
style={{ textDecoration: 'none', fontSize: 15, fontWeight: 600, color: '#3D2B1F', borderBottom: '1.5px solid #A8B89A', paddingBottom: 3 }}
|
||||
>
|
||||
Unsere Geschichte
|
||||
</Link>
|
||||
</div>
|
||||
@@ -68,14 +79,23 @@ export default function HomePage() {
|
||||
Stücke fürs Zuhause
|
||||
</h2>
|
||||
</div>
|
||||
<Link href="/shop" style={{ textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 11, border: '1.5px solid #3D2B1F', color: '#3D2B1F', fontSize: 15, fontWeight: 600, padding: '14px 28px', borderRadius: 44 }}>
|
||||
<Link
|
||||
href="/shop"
|
||||
onClick={() => posthog.capture('hero_cta_clicked', { destination: '/shop', label: 'Zum Shop' })}
|
||||
style={{ textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 11, border: '1.5px solid #3D2B1F', color: '#3D2B1F', fontSize: 15, fontWeight: 600, padding: '14px 28px', borderRadius: 44 }}
|
||||
>
|
||||
Zum Shop <span style={{ fontSize: 18, lineHeight: 1 }}>→</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3,1fr)', gap: 30 }}>
|
||||
{shopProducts.map((p) => (
|
||||
<Link key={p.name} href="/shop" style={{ textDecoration: 'none', color: 'inherit', display: 'block' }}>
|
||||
<Link
|
||||
key={p.name}
|
||||
href="/shop"
|
||||
onClick={() => posthog.capture('product_teaser_clicked', { product_name: p.name, price: p.price })}
|
||||
style={{ textDecoration: 'none', color: 'inherit', display: 'block' }}
|
||||
>
|
||||
<div style={{ position: 'relative', height: 360, borderRadius: 30, overflow: 'hidden', background: p.bg, display: 'flex', alignItems: 'flex-end', justifyContent: 'center', padding: 18 }}>
|
||||
{p.badge && (
|
||||
<span style={{ position: 'absolute', top: 18, left: 18, background: '#A8B89A', color: '#FAFAF7', fontSize: 11.5, fontWeight: 700, letterSpacing: 0.6, padding: '6px 13px', borderRadius: 30 }}>
|
||||
@@ -117,7 +137,11 @@ export default function HomePage() {
|
||||
</div>
|
||||
<h3 style={{ fontFamily: 'var(--font-cormorant, "Cormorant Garamond", serif)', fontWeight: 600, fontSize: 27, margin: '0 0 10px', color: '#FAFAF7' }}>{app.name}</h3>
|
||||
<p style={{ fontSize: 14.5, color: 'rgba(250,250,247,0.6)', margin: '0 0 22px' }}>{app.desc}</p>
|
||||
<Link href={app.href} style={{ textDecoration: 'none', fontSize: 14.5, fontWeight: 600, color: app.linkColor, borderBottom: `1.5px solid ${app.linkColor}50`, paddingBottom: 2 }}>
|
||||
<Link
|
||||
href={app.href}
|
||||
onClick={() => posthog.capture('app_teaser_clicked', { app_name: app.name })}
|
||||
style={{ textDecoration: 'none', fontSize: 14.5, fontWeight: 600, color: app.linkColor, borderBottom: `1.5px solid ${app.linkColor}50`, paddingBottom: 2 }}
|
||||
>
|
||||
Mehr erfahren →
|
||||
</Link>
|
||||
</div>
|
||||
@@ -139,7 +163,7 @@ export default function HomePage() {
|
||||
<p style={{ fontSize: 16, color: '#8a7a68', margin: '0 auto 36px', maxWidth: 460 }}>
|
||||
Sanfte Geschichten, saisonale Rituale und stille Inspiration — etwa einmal im Monat, ganz ohne Eile.
|
||||
</p>
|
||||
<NewsletterForm />
|
||||
<NewsletterForm source="homepage" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user