Install Statsdot on Ghost
Updated October 16, 2026
Add the snippet
- In Ghost Admin, open Settings.
- Find Code injection. In recent versions it is under Advanced.
- Paste your snippet in Site header:
<script defer data-domain="yoursite.com" src="https://statsdot.com/js/script.js"></script>
- Save.
Ghost adds the Site header code to the <head> of every page and post. It is stored in your settings, not in the theme, so it stays when you change or update your theme.
Use the domain your readers see. If your publication also opens on a Ghost(Pro) subdomain, add that domain as a separate site only if readers really use it.
What you will see
Posts, pages, tags and author pages, where readers come from and which campaigns bring them. Readers who open your newsletter in their email app are not counted: email apps do not run scripts. Clicks from the newsletter to your site are counted as visits.
Newsletter signups
If you edit your theme, add the event attribute to the signup form (Ghost marks it with data-members-form):
<form data-members-form="signup" data-statsdot-event="Newsletter signup">
The event is sent when the form is submitted, before Ghost checks the address, so it counts signup attempts. Add Newsletter signup as a goal in the site's Settings (the cog next to the dates) to see its conversion rate. More in Events and goals.
Check that it works
Open your site in a private window and look at the dashboard: within a few seconds you appear among the visitors on the site right now. To leave your own visits out, run localStorage.setItem('statsdot_ignore', '1') once in the browser console on your site.