Analytics

Ryder supports pluggable analytics providers in production. Configure the provider in your site params and the theme will load the matching partial.

Choose a provider

[params]
  analytics_provider = "plausible" # or "posthog"

If analytics_provider is unset, Ryder emits no analytics script.

Plausible

Plausible support is unchanged and stays parameter-driven:

[params]
  analytics_provider = "plausible"
  plausible_domain = "yourdomain.com"
  plausible_advanced = true

Advanced mode keeps the outbound-links script and 404 event behavior already built into the theme.

PostHog

PostHog is intended for sites that want a richer event/session product while keeping the integration in the theme.

[params]
  analytics_provider = "posthog"
  posthog_host = "https://t.example.com"
  posthog_ui_host = "https://us.posthog.com"
  posthog_defaults = "2026-01-30"
  posthog_person_profiles = "identified_only"

The PostHog partial also supports environment variables:

  • PUBLIC_POSTHOG_KEY
  • PUBLIC_POSTHOG_HOST
  • PUBLIC_POSTHOG_UI_HOST

Params take precedence over environment variables.

Tracking clicks with ryderTrack

The theme bundles @alpinejs/csp, whose expression evaluator cannot run function calls, member calls, or arrow functions inside inline directives — and it fails silently. So @click="posthog.capture('x')" never runs and never warns.

Use the ryderTrack component instead. The event name and props travel as data attributes, so nothing inline needs evaluating:

<a href="/tickets/" x-data="ryderTrack" @click="track"
   data-track-event="ticket_link_click"
   data-track-props='{"venue":"The Roxy"}'>Tickets</a>

A live one (open your console — with no analytics provider configured on this demo site, the click is a harmless no-op):

Content Security Policy

Ryder’s CSP partial automatically adds the right script-src and connect-src entries for the active analytics provider. If your site uses Hugo’s getenv in templates, make sure your Hugo security config allows the environment variable names you plan to read.