Ghost Admin > Settings > Code injection > Site Header · open source (MIT) · ask in plain English

Add analytics to Ghost.

Ghost gives publishers a clean editor but only basic member stats. smolanalytics is one script tag you paste into Ghost's site header code injection. It autocaptures pageviews, clicks, scroll depth and errors with no code, and you ask which posts actually get read in plain English rather than exporting CSVs.

Ghost Admin > Settings > Code injection > Site Header
<script src="https://YOUR-INSTANCE/sdk.js"></script>
<script>smolanalytics.init("WRITE_KEY", { host: "https://YOUR-INSTANCE" })</script>

Paste both tags into the Site Header box under Settings > Code injection, then save. Applies to every page and post.

how do I add analytics to ghost?

Ghost gives publishers a clean editor but only basic member stats. smolanalytics is one script tag you paste into Ghost's site header code injection. It autocaptures pageviews, clicks, scroll depth and errors with no code, and you ask which posts actually get read in plain English rather than exporting CSVs.

Ghost has a native slot for this at Settings > Code injection > Site Header, which renders the tags before </head> on every post and page. No theme edits, no Handlebars. Save and the autocapture starts: pageviews per post, scroll depth as a read-completion proxy, outbound link clicks with their element chain, and any JS errors from your theme.

For a Ghost publication the useful questions are editorial and conversion oriented: which post drives the most reads, where members click before subscribing, which referral source converts. Autocapture covers reads and clicks out of the box. Fire smolanalytics.track("subscribe_click") from a button in your theme and call identify(memberId) when a Ghost member signs in to tie sessions together. Then ask "top 5 posts by scroll depth this month" from the bar or your editor, and the answer is a computed report a CI test proves cannot be hallucinated.

Honest pricing: 14-day full trial, no credit card. Then Solo $29/mo, never metered on seats or sites. Overage is $5/million with an emailed receipt, the dashboard never locks, and self-hosting the single Go binary is free forever (MIT).

Add analytics to Ghost tonight.

One snippet, or one endpoint. Tomorrow morning the verdict tells you which part of the funnel to fix.

questions

How do I add analytics to Ghost?
Ghost gives publishers a clean editor but only basic member stats. smolanalytics is one script tag you paste into Ghost's site header code injection. It autocaptures pageviews, clicks, scroll depth and errors with no code, and you ask which posts actually get read in plain English rather than exporting CSVs.
Do I need a cookie banner?
Not in cookieless mode. smolanalytics can run without storing anything on the device, so there is no consent banner to add. You still get visitors, referrers, funnels, retention, and paths, and AI-assistant referrals (chatgpt.com, claude.ai, perplexity.ai) show up as their own channel.
Is it enough for a real product, or just page counts?
It does funnels, retention, paths, cohorts, and a daily verdict on what to fix, from the same events, and you ask it in plain English. It deliberately skips session replay, feature flags, and experiments. If you want a straight answer on what to fix, that you own and can self-host free, it fits.

keep reading