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

ProviderConfig KeyWeightPrivacy-Focused
Google Analytics 4google-analyticsHeavy (Partytown)No
PostHogposthogHeavy (Partytown)Configurable
Microsoft ClarityclarityHeavy (Partytown)No
PlausibleplausibleLightweight (~1KB)Yes
UmamiumamiLightweight (~2KB)Yes
FathomfathomLightweight (~2KB)Yes

Google Analytics 4

{
"integrations": {
"analytics": {
"provider": "google-analytics",
"measurementId": "G-XXXXXXXXXX"
}
}
}
FieldRequiredDescription
measurementIdYesYour GA4 Measurement ID (starts with G-).

PostHog

{
"integrations": {
"analytics": {
"provider": "posthog",
"apiKey": "phc_XXXXXXXXXX",
"apiHost": "https://us.i.posthog.com"
}
}
}
FieldRequiredDescription
apiKeyYesYour PostHog project API key.
apiHostNoAPI host. Defaults to https://us.i.posthog.com.

Microsoft Clarity

{
"integrations": {
"analytics": {
"provider": "clarity",
"projectId": "XXXXXXXXXX"
}
}
}
FieldRequiredDescription
projectIdYesYour Clarity project ID.

Plausible

{
"integrations": {
"analytics": {
"provider": "plausible",
"domain": "docs.example.com"
}
}
}
FieldRequiredDescription
domainYesYour site domain.
scriptUrlNoCustom script URL for self-hosted Plausible.

Umami

{
"integrations": {
"analytics": {
"provider": "umami",
"websiteId": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
}
}
}
FieldRequiredDescription
websiteIdYesYour Umami website ID.
scriptUrlNoCustom script URL for self-hosted Umami.

Fathom

{
"integrations": {
"analytics": {
"provider": "fathom",
"siteId": "XXXXXXXX"
}
}
}
FieldRequiredDescription
siteIdYesYour Fathom site ID.
scriptUrlNoCustom 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 defer and are only ~1-2KB — negligible impact.