Posthog behoben

This commit is contained in:
Timo Knuth
2025-12-11 11:40:38 +01:00
parent 8c5e2fa58e
commit 18f92c4285
8 changed files with 141 additions and 34 deletions

View File

@@ -49,6 +49,23 @@ export default function SignupPage() {
// Store user in localStorage for client-side
localStorage.setItem('user', JSON.stringify(data.user));
// Track successful signup with PostHog
try {
const { identifyUser, trackEvent } = await import('@/components/PostHogProvider');
identifyUser(data.user.id, {
email: data.user.email,
name: data.user.name,
plan: data.user.plan || 'FREE',
signupMethod: 'email',
});
trackEvent('user_signup', {
method: 'email',
email: data.user.email,
});
} catch (error) {
console.error('PostHog tracking error:', error);
}
// Redirect to dashboard
router.push('/dashboard');
router.refresh();