<head> on every page of your site, so you do not need to edit your theme.
You need your site’s public key, which starts with cs_pk_. Find it in CrispStats under Settings, Tracking code, on the HTML tab. The key is safe to publish.
Add the script
1
Copy the tag
example.com with your publication’s domain.2
Paste it into Site header
In Ghost Admin, open Settings, go to Advanced, then Code injection. Paste the tag into Site header and save. Use the site-wide box, not the code injection of a single post, so every page is covered.
3
Open your site
Open your publication in a private window, signed out. The status row on the CrispStats Tracking code tab shows Receiving events. once the first event has been stored.
Ghost’s help page for code injection does not mention a plan requirement. If you use Ghost(Pro) and do not see Code injection, check what your plan includes with Ghost.
Check that it works
- Open a post with the browser’s developer tools on the Network tab. You should see
d.jsload fromin.crispstats.comand aPOSTtohttps://in.crispstats.com/ethat gets202. - Open the page source and search for
in.crispstats.com/d.js. If it is missing, your theme may not output Ghost’s head code: themes must include{{ghost_head}}in their default layout. - In CrispStats, the visit appears in Realtime within seconds.
How page changes are counted
Each Ghost page is a full page load, so the script counts one pageview per post or page. A change that only touches the part of the URL after#, such as a pop-up that opens over the page, is not a separate pageview: the script drops the fragment unless the tag has data-hash, which a Ghost site does not need. If your newsletter links carry UTM parameters, the script keeps them and the campaign shows under Sources. See traffic channels.
Add optional modules
Add attributes to the tag in Site header and save:data-outbound counts clicks to other sites. data-404 sends a 404 event on not-found pages that carry the marker, see 404 pages. Script attributes lists the rest.
Send custom events
Inside a post, an HTML card can carry adata-cs-event link or button:
FAQ
Does it count members and anonymous readers?
Does it count members and anonymous readers?
It counts every visit the same way, with an anonymous daily visitor id. It does not know who is a member unless you call
crispstats.identify() yourself. See identify signed-in users.Does a theme change remove the script?
Does a theme change remove the script?
No. Code injection is a site setting, separate from your theme.
Next steps
AI traffic
See readers who arrive from ChatGPT, Perplexity and other assistants.
Outbound links
See which links in your posts get clicked.
Public dashboard
Share your readership numbers with a link.
Ghost details (Settings, Advanced, Code injection, and Site header output inside
<head>) are from Ghost’s help and tutorial pages, https://ghost.org/help/code-injection-styles/ and https://ghost.org/tutorials/use-code-injection-in-ghost/, read on 2026-11-23.