H

Beam for Hugo

Beam is a strong fit for Hugo publishers and docs sites: one deferred script, no cookies, and decision-ready analytics without shipping a heavy client-side bundle.

Get started free Explore live demo

No credit card required and setup in minutes

Install Beam on Hugo

Replace YOUR_SITE_ID with your Beam site ID from the dashboard.

Recommended: create a shared partial and include it in baseof.html

<!-- layouts/partials/beam-analytics.html -->
<script
  defer
  src="https://beam.keylightdigital.dev/js/beam.js"
  data-site-id="YOUR_SITE_ID">
</script>

<!-- layouts/_default/baseof.html -->
<!doctype html>
<html lang="{{ site.Language.Lang | default "en" }}">
  <head>
    {{ partial "beam-analytics.html" . }}
  </head>
  <body>
    {{ block "main" . }}{{ end }}
  </body>
</html>

Using a dedicated partial keeps tracking in one file across homepage, section lists, and single pages. Need your ID first? Create a site at /dashboard/sites/new.

Theme fallback: place script directly in head partial

<!-- themes/your-theme/layouts/partials/head/custom.html -->
<script
  defer
  src="https://beam.keylightdigital.dev/js/beam.js"
  data-site-id="YOUR_SITE_ID">
</script>

Many Hugo themes expose a custom head partial. This is the lowest-friction install when you do not want to edit base templates.

Verify your Hugo integration

Use this checklist after publish so you know tracking is actually live in production.

  • Run `hugo --gc --minify` or your normal deploy pipeline, then open your production homepage and one content page in a private window.
  • In Beam dashboard, pick Today and confirm both URLs appear in Top Pages within about a minute.
  • Check Referrers and Channels panels to validate decision-ready source visibility, not just raw pageview counts.

Why Beam works well for Hugo

Sub-2KB script for static performance

Beam keeps Hugo pages fast with a tiny deferred script instead of a client-heavy analytics bundle.

🍪

No cookies, no consent-banner overhead

Beam does not set cookies or store personal identifiers, so privacy compliance stays simple.

🧠

Decision-ready analytics

Go beyond passive counters with top pages, channels, referrers, goals, and plain-English insights.

🧱

Works with any Hugo theme structure

Install via shared partials or theme head includes without adding build plugins or JS frameworks.

Ready to add Beam to Hugo?

Start free, validate your first pageview, and then scale when traffic grows.

Related setup guides