Getting started

Install 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 Clerion; it carries your real key and site id.

You may not need this page. When you add your site, Clerion recognises WordPress, Shopify, Webflow, Squarespace, Wix and Next.js from the page itself and shows the steps for yours next to the snippet. If someone else edits your site, send them the snippet from there: they get the line and these steps, and their reply comes to you.

Plain HTML

Paste it anywhere inside <head> on every page. It loads deferred, so it never slows the page.

WordPress

The easiest way is the free WPCode plugin: open Code Snippets, then Header & Footer, and paste it into Header. If you would rather edit the theme, paste it into header.php just before </head>, in a child theme, since a parent theme update can overwrite header.php.

Shopify

Open Online Store, Themes, then the ⋯ menu and Edit code. Open layout/theme.liquid and paste it just before </head>. It loads on every storefront page your theme controls.

Webflow

Go to Site settings, Custom code, paste it into Head code, then publish. Webflow applies it site-wide, so one paste covers every page.

Squarespace

Open Settings, search for Code Injection, and paste it into Header. It applies to every page.

Wix

Go to Settings, Custom Code, Add Custom Code. Paste it, then pick All pages and Head. Wix only allows custom code on a premium plan connected to your own domain.

Next.js and React

Paste it inside <head> in app/layout (or pages/_document on the pages router), then deploy. 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.

Something missing or wrong here? Write to hello@getclerion.com, or ask from inside the app.