"""Optional PostHog analytics. Loads only when POSTHOG_KEY is configured. POSTHOG_KEY is a public (client-side) project key, not a secret; set it as a Space *variable*. CTA clicks fire `hf_loreify_cta_clicked` with placement, generated_before_click, and device_type (wired in ctas.py). """ import json import os def analytics_head() -> str: key = os.environ.get("POSTHOG_KEY", "") if not key: return "" host = os.environ.get("POSTHOG_HOST", "https://us.i.posthog.com") return ( "" )