Content management systems
Ghost analytics with CrispStats
To add CrispStats to a Ghost publication, paste the script tag into the Site header box under Settings, Advanced, Code injection in Ghost Admin, and save. Ghost outputs that code inside the head of every page, so you do not edit your theme, and a theme change does not remove it.
Updated
Set up CrispStats on Ghost
- 01
Step 1: Copy the tag with your key
In the CrispStats dashboard, open your site’s Settings, select Tracking code and copy the tag from the HTML tab. Replace
example.comwith your publication’s domain if it is not filled in. The public key starts withcs_pk_and is safe to publish.Replace the highlighted values with your own.
<scriptdeferdata-site="cs_pk_your_site_key"data-domains="example.com"src="https:/ / in. crispstats. com/ d. js"></script> - 02
Step 2: Open Code injection in Ghost Admin
Ghost’s help page on code injection puts it under Settings, Advanced, Code injection. Code in Site header is output inside
<head>; code in Site footer goes before</body>. - 03
Step 3: Paste it into Site header and save
Paste the tag into Site header and save. Use the site-wide box, not the code injection of a single post, so every post, tag page and author page is covered.
- 04
Step 4: Open your publication signed out
Open your site in a private window, signed out of Ghost Admin, and read a post or two.
- 05
Step 5: Turn on extra events (optional)
Add attributes to the tag in Site header.
data-outboundcounts clicks on links to other sites, so you see which links in your posts get used.data-404sends a404event on not-found pages that carry the marker; see 404 pages.<scriptdeferdata-site="cs_pk_your_site_key"data-domains="example.com"data-outbounddata-404src="https:/ / in. crispstats. com/ d. js"></script> - 06
Step 6: Count a click inside a post (optional)
In an HTML card, give a link or button a
data-cs-eventattribute, with properties fromdata-cs-prop-attributes. No JavaScript is needed.<a href="https://example.com/course" data-cs-event="course click" data-cs-prop-post="launch-notes">See the course</a>
Check that it works
Open a post with the developer tools on the Network tab. You should see d.js load from in.crispstats.com and a POST to /e that gets 202, and the visit appears on the Realtime screen within seconds. If the tag is missing from the page source, your theme may not output Ghost’s head code: themes must include {{ghost_head}} in their default layout.
CrispStats on Ghost
What you get
- Pageviews, unique visitors and sessions for every post, page, tag archive and author page.
- Where readers come from: search, social, newsletters whose links carry UTM parameters, and AI assistants such as ChatGPT and Perplexity, as their own channel.
- Entry pages, so you see which posts bring new readers in, with countries, devices and browsers.
- Clicks on outbound links in your posts, and member sign-ups as goals when the sign-up flow ends on a page you can name.
- A public dashboard to share readership numbers with sponsors through a read-only link, off by default.
Notes and limits
- CrispStats does not report on newsletter subscribers, email opens or clicks inside emails. Ghost stays the place for those; links from your newsletter show as a source once they carry UTM parameters.
- Members and anonymous readers are counted the same way, with an anonymous visitor id that rotates daily. It does not know who is a member unless you call
crispstats.identify()yourself. - Ghost’s code injection help page does not state a plan requirement, and the Ghost(Pro) pricing page read on 2026-11-23 does not list code injection by plan. If you do not see it, check with Ghost what your plan includes.
- Each Ghost page is a full page load, so one pageview per post. A pop-up that only changes the part of the URL after
#is not a new page. - On a self-hosted Ghost behind nginx, you can serve the script from your own domain with one forwarding rule: see the proxy guide.
The docs page covers the optional steps this guide leaves out.
Setup questions. Straight answers.
What people ask before they connect it.
No. Code injection is a site setting, separate from your theme, so the tag stays when you switch or update themes. The theme only needs to output Ghost's head code, which standard themes do.
It answers different questions. Ghost covers members, newsletters and email opens, which CrispStats does not. CrispStats adds sources, AI assistant referrals, entry pages, outbound clicks and web vitals without cookies.
No. Every visit is counted the same way with an anonymous daily visitor id. To tie visits to a member, call identify from your own code after sign-in.
CrispStats sets no cookies and stores nothing on the reader's device by default. Ghost's member sign-in and other scripts may, so check the whole site. This is not legal advice.
Each post view is one event. Every account starts with a 14-day free trial with every feature, public dashboards for sponsors included, and no card; then Starter is $5 a month for 250,000 events.
Not answered here? Write to hello@crispstats.com
Go further
Related
- Privacy-friendly analytics for bloggers
See which posts get read to the end, where readers come from, including AI assistants, and keep your site free of analytics cookies.
- Track visitors from ChatGPT and Perplexity
How to see visits sent by AI assistants: the referrers and UTM tags to look for, why much of it shows as direct, and how to log AI crawlers.
- UTM parameters: a practical guide
What the five UTM parameters do, a naming convention you can copy, the mistakes that split your reports, and how the medium decides the channel.
- Public dashboards
Share a read-only dashboard with a link that needs no account.
- WordPress analytics
Add CrispStats to WordPress with a wp_head action in a small site plugin of your own.
- Jekyll analytics
Add CrispStats to a Jekyll site by pasting one script tag into the head include, overriding the theme's copy.
Other integrations
Content management systems
Frameworks
Site builders
Ecommerce platforms
Tag managers
Your traffic, crisp and clear
One script, no cookies, and every feature from the first day. Set up takes about as long as pasting a snippet.