Docs
Ghost
Two ways to add the script: Code Injection in the admin, or your theme template. Takes about two minutes.
Option A — Code Injection
In Ghost admin, go to Settings → Code injection → Site header and paste the snippet, then save:
<script defer src="http://localhost:3000/analytics.js" data-website-id="YOUR_TRACKING_ID"></script>Option B — theme template
Self-hosting a custom theme? Add the same tag before </head> in default.hbs.
Track custom events
Call the global function from Code Injection (Site footer) or your theme's JavaScript:
lumen("Signup", { plan: "pro" });Verify
Reload your site and open the site's real-time view in your dashboard. The pageview should appear within seconds. If not, see Troubleshooting.