Skip to content

Tracking Scripts

WollyCMS lets you manage tracking scripts (Google Analytics, Plausible, custom pixels, etc.) from the admin UI without touching your frontend code.

Navigate to System → Tracking in the admin UI. Add scripts with:

  • Name — Descriptive label (e.g., “Google Analytics”, “Facebook Pixel”)
  • Code — The script tag or inline JavaScript
  • Position — Head or body placement
  • Enabled — Toggle scripts on/off without deleting them

Tracking scripts are stored in the CMS and served via the content API. Your Astro layout fetches them and injects them into the page:

---
import { getWolly } from '../lib/wolly';
const scripts = await getWolly().tracking.list();
const headScripts = scripts.filter(s => s.position === 'head');
const bodyScripts = scripts.filter(s => s.position === 'body');
---
<html>
<head>
{headScripts.map(s => <Fragment set:html={s.code} />)}
</head>
<body>
<slot />
{bodyScripts.map(s => <Fragment set:html={s.code} />)}
</body>
</html>
  • Analytics — Google Analytics, Plausible, Fathom, Matomo
  • Tag managers — Google Tag Manager, Segment
  • Conversion pixels — Facebook, LinkedIn, Twitter
  • Chat widgets — Intercom, Crisp, Drift
  • Custom scripts — Any JavaScript you want managed through the CMS
  • Non-developers can manage tracking — No code deployments needed
  • Toggle without deploys — Enable/disable scripts instantly
  • Centralized management — All tracking code in one place
  • Per-environment control — Different scripts for staging vs production