3 steps
- Get early access and sign in.
- In the dashboard, open the site menu (bottom left) → Add site and enter your domain.
- Copy the snippet from Settings and paste it into your site. Your site ID is already filled in.
Any website
Paste this inside <head> on every page:
<script defer
data-site-id="YOUR_SITE_ID"
src="https://your-cloudline-domain/tracker.js"></script>
Events are only accepted from the domain you added (and its subdomains), so a copied snippet can’t send data into your site.
Next.js (App Router)
// app/layout.tsx
import Script from 'next/script';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
{children}
<Script
defer
data-site-id="YOUR_SITE_ID"
src="https://your-cloudline-domain/tracker.js"
strategy="afterInteractive"
/>
</body>
</html>
);
}
Client-side navigation is picked up automatically. No router hooks needed.
WordPress
Use a header-scripts plugin (for example “WPCode”) or your theme’s Theme File Editor → header.php, and paste the snippet just before </head>.
Webflow & Framer
Webflow: Site settings → Custom code → Head code. Framer: Site settings → General → Custom code → End of <head>. Publish afterwards.
Track clicks
<button data-cloudline-track="signup_cta">Start free trial</button>
Only the label you choose is stored. From JavaScript you can also call Cloudline.track('click', { label: 'pricing_toggle' }).
Check it works
Open your site in a new tab, then open the dashboard → Realtime. Today’s views update every few seconds.
Troubleshooting
- Nothing shows up: make sure the domain in the dashboard matches the site exactly (subdomains are included).
- Content Security Policy: allow the Cloudline domain in
script-srcandconnect-src. - Ad blockers: some block analytics scripts entirely. Numbers from those visitors won’t appear.
- Localhost: events from
localhostare refused in production so test traffic doesn’t pollute real data.