How to track visitors on Ghost.
Ghost keeps site-wide scripts in Code Injection, which is separate from your theme. Paste once and every post and page is covered, including ones written later.
What you need
- • Ghost admin access — the Administrator role, or Owner.
- • A VisitorPing site key, in the form vp_ABC23456 — the prefix vp_ and eight characters. The alphabet leaves out I, O, 0 and 1, so there is nothing to misread when copying it.
Install it
- 1
Open Code Injection
Sign in at yourdomain.com/ghost, then Settings — the gear at the bottom left — and choose Code Injection.
- 2
Paste into Site Header
Put the tag in the Site Header box with your own key in place of vp_ABC23456, then Save at the top right.
Site Header applies to every page. There is a per-post injection field elsewhere; you do not want that one here.
<script defer crossorigin="anonymous" src="https://cdn.visitorping.com/site/vp_ABC23456.js"></script> - 3
Check a published post
Open any published post in a private window and view the source. The tag should be in the head.
Why not edit the theme
You can add the tag to default.hbs in a custom theme instead, and for a theme you maintain yourself that is fine. For anything else, Code Injection is the better place: a theme update or a switch to a different theme wipes the edit, and Code Injection survives both.
What you will actually see
Per visit: the city and region the network resolves to, where the visitor came from, the page they landed on, their device and browser, and whether they have been before.
You do not get a name, an email address, or an identity. Nobody can give you that from a page view, whatever the marketing says. Geolocation resolves a network rather than a doorstep, so a visitor on a VPN or a mobile network can appear in the wrong city entirely. Treat location as a hint.
You are collecting visitor data, so say so in your privacy notice and check which consent rules apply where your customers are — a question for your own legal advice, not for a setup guide.
If it is not working
- Nothing appears on the site
- Check you pasted into Site Header rather than Site Footer, and that you saved — Ghost does not warn you when leaving with unsaved changes in this panel.
- It works on posts but not the home page
- That is the per-post injection field rather than the site-wide one. Move the tag to Settings → Code Injection → Site Header.
Find what is costing you search clicks, then watch the fix work.
VisitorPing reads your own Search Console data for the pages losing clicks, then rings your phone the moment someone lands on your website.