# How to Write the Public Dashboard URL in Plausible-Hugo

> Learn how to write the public dashboard URL in Plausible-Hugo. This guide explains how to enable and configure your site to display the public dashboard URL for better insights.

- Repository: [divinerites/plausible-hugo](https://github.com/divinerites/plausible-hugo)
- Tags: how-to-guide
- Published: 2026-02-28

---

**Plausible-Hugo writes the public dashboard URL as an HTML comment only when `public_dashboard` is enabled in your site configuration, using the partial [`layouts/partials/plausible_head_public_url.html`](https://github.com/divinerites/plausible-hugo/blob/main/layouts/partials/plausible_head_public_url.html) to concatenate your page domain with your Plausible domain.**

The `divinerites/plausible-hugo` module streamlines analytics integration for Hugo static sites. When you need to expose your analytics publicly, understanding how the public dashboard URL is written into your site's HTML ensures you can verify the configuration and troubleshoot visibility issues.

## Where the Public Dashboard URL Logic Lives

The generation logic resides in [`layouts/partials/plausible_head_public_url.html`](https://github.com/divinerites/plausible-hugo/blob/main/layouts/partials/plausible_head_public_url.html). This partial evaluates whether `site.Params.plausible.public_dashboard` is set to `true` before writing any output.

When the flag is enabled, the partial constructs the URL using two parameters:

- **`.Domain`** – the domain of the current page, supplied automatically by Hugo's page context.
- **`site.Params.plausible.domain`** – your registered Plausible domain (e.g., `example.com`).

## How the Public Dashboard URL Is Constructed

The partial concatenates these values to form the complete public dashboard path. It prefixes the result with `https://` and outputs the result as an HTML comment.

The resulting format is:

```html
<!-- Plausible Analytics public dashboard URL : https://<page-domain>/<plausible-domain> -->

```

This comment appears in your generated HTML source but does not render visually on the page. It serves as a metadata marker for debugging and verification purposes.

## Configuring the Public Dashboard URL in config.toml

To enable this output, add the following to your [`config.toml`](https://github.com/divinerites/plausible-hugo/blob/main/config.toml):

```toml
[params.plausible]
  domain           = "your-plausible-domain.com"
  public_dashboard = true

```

If `public_dashboard` is omitted or set to `false`, the partial renders nothing, keeping your HTML output clean.

## Distinguishing the Public URL Comment from the Dashboard Embed

It is important to note that the HTML comment generated by [`plausible_head_public_url.html`](https://github.com/divinerites/plausible-hugo/blob/main/plausible_head_public_url.html) is purely informational. The actual embedded dashboard that visitors can view is handled by a separate partial: [`layouts/partials/plausible_dashboard.html`](https://github.com/divinerites/plausible-hugo/blob/main/layouts/partials/plausible_dashboard.html).

This embed partial requires a different configuration parameter:

```toml
[params.plausible]
  dash_link = "https://plausible.io/share/xxxx"

```

The embed partial constructs an iframe using this shared link, while the public URL comment simply documents the theoretical dashboard location.

## Summary

- The public dashboard URL is written as an HTML comment by [`layouts/partials/plausible_head_public_url.html`](https://github.com/divinerites/plausible-hugo/blob/main/layouts/partials/plausible_head_public_url.html).
- Output only occurs when `site.Params.plausible.public_dashboard` is set to `true`.
- The URL combines the current page domain with your configured Plausible domain.
- This comment is distinct from the functional dashboard embed, which uses `dash_link` and [`plausible_dashboard.html`](https://github.com/divinerites/plausible-hugo/blob/main/plausible_dashboard.html).

## Frequently Asked Questions

### What happens if I enable public_dashboard but don't see the comment?

Verify that `site.Params.plausible.domain` is set correctly in your [`config.toml`](https://github.com/divinerites/plausible-hugo/blob/main/config.toml). The partial checks for both the `public_dashboard` flag and a valid domain parameter before rendering the comment. If either is missing, the output remains empty.

### Can visitors see the public dashboard without the embed partial?

No. The HTML comment generated by [`plausible_head_public_url.html`](https://github.com/divinerites/plausible-hugo/blob/main/plausible_head_public_url.html) is invisible to visitors and only appears in the page source. To display the actual dashboard, you must use the [`plausible_dashboard.html`](https://github.com/divinerites/plausible-hugo/blob/main/plausible_dashboard.html) partial with a valid `dash_link` parameter configured.

### Why does the URL format use https://<domain>/<plausible-domain>?

This structure reflects Plausible Analytics' public dashboard URL convention, where your site domain precedes your Plausible account domain in the path. The partial constructs this automatically to match Plausible's expected routing format for public stats access.

### Is the public_dashboard flag required for the embed to work?

No. The dashboard embed functionality operates independently using the `dash_link` parameter. You can embed a shared dashboard without enabling `public_dashboard`, and conversely, you can enable the public URL comment without embedding the dashboard iframe.