Analytics
Lito supports 6 analytics providers out of the box. Heavier scripts (Google Analytics, PostHog, Clarity) run off the main thread via Partytown, while lightweight providers (Plausible, Umami, Fathom) load with defer — so your Lighthouse scores stay perfect either way.
Supported Providers
| Provider | Config Key | Weight | Privacy-Focused |
|---|---|---|---|
| Google Analytics 4 | google-analytics | Heavy (Partytown) | No |
| PostHog | posthog | Heavy (Partytown) | Configurable |
| Microsoft Clarity | clarity | Heavy (Partytown) | No |
| Plausible | plausible | Lightweight (~1KB) | Yes |
| Umami | umami | Lightweight (~2KB) | Yes |
| Fathom | fathom | Lightweight (~2KB) | Yes |
Google Analytics 4
{ "integrations": { "analytics": { "provider": "google-analytics", "measurementId": "G-XXXXXXXXXX" } }}| Field | Required | Description |
|---|---|---|
measurementId | Yes | Your GA4 Measurement ID (starts with G-). |
PostHog
{ "integrations": { "analytics": { "provider": "posthog", "apiKey": "phc_XXXXXXXXXX", "apiHost": "https://us.i.posthog.com" } }}| Field | Required | Description |
|---|---|---|
apiKey | Yes | Your PostHog project API key. |
apiHost | No | API host. Defaults to https://us.i.posthog.com. |
Microsoft Clarity
{ "integrations": { "analytics": { "provider": "clarity", "projectId": "XXXXXXXXXX" } }}| Field | Required | Description |
|---|---|---|
projectId | Yes | Your Clarity project ID. |
Plausible
{ "integrations": { "analytics": { "provider": "plausible", "domain": "docs.example.com" } }}| Field | Required | Description |
|---|---|---|
domain | Yes | Your site domain. |
scriptUrl | No | Custom script URL for self-hosted Plausible. |
Umami
{ "integrations": { "analytics": { "provider": "umami", "websiteId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" } }}| Field | Required | Description |
|---|---|---|
websiteId | Yes | Your Umami website ID. |
scriptUrl | No | Custom script URL for self-hosted Umami. |
Fathom
{ "integrations": { "analytics": { "provider": "fathom", "siteId": "XXXXXXXX" } }}| Field | Required | Description |
|---|---|---|
siteId | Yes | Your Fathom site ID. |
scriptUrl | No | Custom script URL for self-hosted Fathom. |
Performance
Lito ensures analytics never degrade your site performance:
- Partytown providers (GA, PostHog, Clarity) run in a web worker off the main thread, keeping the UI fully responsive.
- Lightweight providers (Plausible, Umami, Fathom) load with
deferand are only ~1-2KB — negligible impact.
Tip
If you care about visitor privacy and want the smallest footprint, choose Plausible, Umami, or Fathom. All three are cookie-free and GDPR-friendly by default.
Was this page helpful?