PostHog Test Page

Use this page to test PostHog event tracking. Events will be sent to your PostHog instance.

PostHog: Not Initialized

Events are sent via captureEvent from analytics lib, which sends directly to PostHog (with GTM fallback). The lib will wait for PostHog if it hasn't loaded yet.

🔍 PostHog Initialization Diagnostics

Using posthog-js/react with usePostHog() hook (not window.posthog)

Environment Variables:

NEXT_PUBLIC_MX_POSTHOG_API_KEY:
NEXT_PUBLIC_MX_POSTHOG_API_HOST:

PostHogProvider:

Unknown status

usePostHog() Hook (Primary Method):

✗ usePostHog() returns null/undefined

window.posthog (for analytics lib compatibility):

✗ window.posthog does not exist
⚠️ This is a problem! The analytics library requires window.posthog to send events.
When posthog.init() is called, it should set window.posthog automatically.

Console Logging

Loading...

When enabled, events are logged to browser console with 🔰 prefix. Always enabled in development.

Test Events

How to Use

  • TEST_EVENT: Sent via captureEvent from lib/analytics.js
  • The analytics lib sends directly to PostHog (with GTM fallback) and will wait for PostHog to initialize if needed.
  • Check your PostHog dashboard to verify events are being received
  • Open browser console to see detailed event logs (if logging is enabled)