Repository navigation
Tracking and consent
Analytics, ads pixels and a cookie banner, written into your pages by CraftPages. There's no outside consent service, no account and no fee: the banner is a small script that ships with your site.
Open Site → Tracking & consent in the sidebar.
Under Analytics & tracking, Add a service, pick it and paste its ID. Add to every
page writes its tag into each page's <head>, and into pages you add later (before each
publish, new pages get the tags too).
| Group | Services |
|---|---|
| Analytics | Google Analytics 4, Google Tag Manager, Microsoft Clarity |
| Ads and marketing | Meta Pixel, LinkedIn Insight Tag, TikTok Pixel |
| Analytics without cookies | Plausible, Umami, Cloudflare Web Analytics |
| Other | Any snippet you paste (only its <script> tags are added) |
Each field says where the ID is found, e.g. for Google Analytics: Admin → Data streams →
your site, an ID starting with G-.
- Edit changes the ID; Remove takes the tag off every page.
- If your pages already load the same service from code pasted by hand, CraftPages says so, so visits aren't counted twice.
- Pages without tracking: Leave out a page… for a thank-you page or a private page. The mark is in the page itself, so it stays left out.
Each tag carries a mark naming the service, so CraftPages can change or remove it later without touching anything else on the page.
In the EU and UK, analytics that set cookies, ads pixels and embeds such as YouTube or Google Maps need the visitor's consent before they load. When consent is off, the screen lists what your pages load that needs it.
Turn on cookie consent. CraftPages then:
- finds the analytics, pixels and embeds on every page (about 45 tools are recognised) and holds each one until the visitor allows its category: Analytics, Marketing or Embedded content;
- adds the banner to every page: Reject, Choose and Accept side by side; the choice is remembered for 12 months;
- sends Google Consent Mode v2 signals for Google tags;
- shows a short note with an Allow button in place of each embed until it's allowed.
A held script is written as type="text/plain" with a mark naming its category, so browsers
skip it. After the visitor agrees, the banner's script runs it, in page order.
Try it opens your home page with the choices open. What you choose there stays in that preview.
Turn off puts every tag back exactly as it was.
Every script and embed from another site, on which pages, and what it does Now: waits for consent, runs (needed by the site), or runs because it sets no cookies.
- A script CraftPages doesn't recognise runs without asking until you choose its category.
- Necessary lets a script run for everyone: spam protection, payments, the site's own code. The choice is written into the tag, so it's kept.
- Recognised scripts added later (by hand, by an AI, on a new page) are held before the next publish.
Analytics added from Analytics & tracking while consent is on are written already waiting. Adding one while consent is off says whether it needs consent and offers to turn consent on. Plausible, Umami and Cloudflare Web Analytics set no cookies and run without a banner.
- Position: a bar along the bottom, or a box in the corner.
-
Text: built in for English, Italian, Ukrainian, German, French and Spanish, picked by
the page's
lang. Fill in the fields to use your own words, per language on a site in several languages (Sites in several languages). - Privacy page: the page that explains what you collect, linked from the banner.
-
Opening it again: a small button in the corner, or the
data-craftpages-consent-openattribute on any link of your own, such as "Cookie settings" in the footer.
Pages added after consent was turned on show as missing the banner, with Add it; it's also added before each publish.
Everything stays in your pages: the tags, the marks, and one script,
/assets/craftpages-consent.js. Nothing is loaded from CraftPages. The visitor's choice is
kept in their own browser (local storage) for 12 months, and they're asked again when the site
starts using a new category. Taking consent back removes the cookies that category's tools
set.
CraftPages doesn't give legal advice. Your privacy page should say what you collect and why.
Getting started
Guides
- Writing a blog
- Sites in several languages
- SEO
- Tracking and consent
- Forms
- Editing code
- Working with others
- Sync between computers
- Upgrading
- Connect an AI
- Troubleshooting
Development