Guides / Once your site is running

Plausible Analytics on a Ghost site

Plausible counts visits without cookies. One snippet is enough to start, and on your own server eight lines in the Caddyfile run it through your domain.

One snippet The simple way
Pasted into Ghost Admin's code injection. It counts on every page of the site.
Eight lines Through your own domain
In the Caddyfile of a server you run. Script and events then come from your domain.
5–25 % What blockers hide
Plausible's own estimate of the visits a site misses without a proxy.

Before you add it

Since version 6 Ghost counts visits itself, without cookies, in the Analytics part of its settings. If that's enough for you, stop here.

There are two good reasons to add Plausible all the same. A Ghost installed with Ghost-CLI can't use Ghost's own web analytics, which need the Docker installation. And if you already watch other sites in Plausible, you'll want this one beside them. Ghost's help says outright that the two can run together.

The simple way

In Plausible, open the settings of your site and copy the snippet under Site installation. It looks like this, with your own script name in place of pa-XXXXX:

<script async src="https://plausible.io/js/pa-XXXXX.js"></script>
<script>
  window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
  plausible.init()
</script>

In Ghost Admin, go to Settings, Advanced, Code injection, paste the snippet into Site header and save. Ghost then writes it into the head of every page.

Through your own domain

Some readers use blockers that stop every counting script, whatever it does with the data. Plausible puts the visits a site loses that way at 5 to 25 %, depending on its readers. A proxy gets round that: the script and the events travel through your own domain, as your pages do.

You need a web server you control for it. With Caddy, which comes with Ghost's Docker installation, add this to the block of your domain in the Caddyfile, above the line that hands everything else to Ghost:

@plausible path /_cls/script.js /_cls/event
handle @plausible {
    rewrite /_cls/script.js /js/pa-XXXXX.js
    rewrite /_cls/event /api/event
    reverse_proxy https://plausible.io {
        header_up Host {http.reverse_proxy.upstream.hostport}
    }
}

/_cls is a name I made up, so pick your own. The first line names the two paths on your site. The two rewrite lines turn them into the ones Plausible knows: put your own script name in place of pa-XXXXX. header_up gives Plausible its own host name. Caddy passes the reader's IP address along itself, which Plausible needs to tell visitors apart. Reload Caddy after the change.

Then point the snippet in Ghost's code injection at your own paths:

<script async src="/_cls/script.js"></script>
<script>
  window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
  plausible.init({
    endpoint: "/_cls/event"
  })
</script>

Plausible's guide for Caddy shows the same with the paths /js/script.js and /api/event. I tried the version with my own name on Caddy 2.8.4. If you run Plausible yourself, put its domain in place of https://plausible.io.

Check that it's counting

Open your site in a private window, then the network tab of the browser's developer tools, and load a page. You should see the script arrive from your own domain and, a moment later, a request to your event path. In Plausible the visit shows up shortly after.

Then switch a blocker on and load the page again. If both requests still go through, the proxy is working.

On Ghost(Pro) and other hosts

A host that runs Ghost for you runs the web server too, so there is no Caddyfile to change. The simple way works there as it does everywhere.

Rather not set it up yourself?

I'll set up Ghost and your theme for one fixed price, and tell you first which plan or server you need.

See the servicesSee the themes

Prices, limits and steps are taken from the price lists and docs named above, read on 17 November 2026.