--- title: "Hugo" description: "Add Pulse analytics to your Hugo site via a partial or base template." category: "ssg" brandColor: "#FF4088" officialUrl: "https://gohugo.io/documentation" relatedIds: ["jekyll", "eleventy", "astro"] date: "2026-03-28" --- Add the Pulse script via a Hugo partial or directly in your base template. --- ## Method 1: Create a partial Create an analytics partial with a production guard using Hugo's `.Site.IsServer` flag. ```html filename="layouts/partials/analytics.html" {{ if not .Site.IsServer }} {{ end }} ``` ## Method 2: Include the partial in your base layout Add the partial to your `baseof.html` layout. ```html filename="layouts/_default/baseof.html"
{{ partial "analytics.html" . }}