Docs Getting started
View as MarkdownInstall on your platform
Clerion needs one line in the head of every page you want counted. It works on any site that lets you add to its HTML head. Copy the line from your dashboard; it carries your real key and site id.
Plain HTML
Paste it anywhere inside <head> on every page. It loads deferred, so it never slows the page.
WordPress
Paste it into your theme's header.php just before </head>, or use any header-scripts plugin if you would rather not touch theme files. A child theme is the safer home, since a parent theme update can overwrite header.php.
Shopify
Open Online Store, Themes, Edit code, then layout/theme.liquid, and paste it just before </head>. It loads on every storefront page your theme controls.
Webflow
Go to Project settings, Custom code, paste it into Head code, then publish. Webflow applies it site-wide, so one paste covers every page.
Squarespace
Use Settings, Advanced, Code injection, Header. It applies to every page.
Wix
Use Settings, Custom code, and add it to Head on all pages.
Next.js and React
Put it in your root layout's head, or render it with next/script using the afterInteractive strategy:
import Script from "next/script";
<Script
src="https://api.getclerion.com/sdk/clerion-analytics.js"
data-api-key="YOUR_API_KEY"
data-website-id="YOUR_WEBSITE_ID"
strategy="afterInteractive"
/>
Client-side route changes are counted as pageviews, so a single-page app behaves like any other site. Vue, Nuxt, Svelte and other frameworks work the same way: one tag in the document head.
Anything else
Framer, Ghost, Astro, Hugo, Laravel, Rails, Django and hand-written HTML all work. If you can add one line to the head, you can run Clerion.
Google Tag Manager
You can load Clerion through Tag Manager, but we would rather you did not. Ad blockers block the tag manager itself on a large share of devices, so loading Clerion through it hands back the accuracy you installed Clerion to get. Paste the line directly instead.
Content Security Policy
Only a strict CSP needs a change. Allow the Clerion script source and its collection endpoint in your script-src and connect-src directives. The exact hosts are shown with your snippet in the dashboard.
One snippet per page
Keep the line on each page once. Two copies on a page count every visit twice; see Check your installation if your numbers look too high.