Headless CMS
With a headless CMS there is no head field to paste a snippet into, so the Ours Privacy Web SDK is installed in the front end that renders your content.
Ours Privacy works with every headless CMS. The install just happens in a different place than you might expect, so this page explains where to look.
A headless CMS stores and delivers content over an API. It does not render your pages, which means it has no <head> for a tracking snippet to live in. The Ours Privacy Web SDK goes into the front-end application that fetches your content and renders the site visitors actually see.
Ask What Renders Your Site
The useful question is not "how do I install on my CMS" but "what framework renders my pages." The answer determines the install, and it is the same regardless of which headless CMS sits behind it.
This applies to Sanity, Contentful, Contentstack, Strapi, Storyblok, Prismic, Payload, Hygraph, Directus, and any other API-first content platform.
Once you know the framework, follow its guide:
- Next.js: the most common front end for headless content.
- Vite and React Router: single-page applications.
- Framer and Webflow: when a visual builder renders content pulled from an API.
If your framework does not have a guide yet, the pattern is the same everywhere: add the snippet from the Install Ours page to whatever template or layout produces the <head> of every page. For most frameworks that is a single root layout file.
Tracking Content Attributes
Reporting on content fields that live in your CMS, such as content type, category, author, or locale, is a common goal with a headless setup. Your front end already has the content entry in hand when it renders, so pass the fields you care about as event properties:
ours('track', 'Article Viewed', {
content_type: 'blog_post',
category: 'compliance',
locale: 'en-us',
});No additional API call is needed, and no CMS configuration changes.
Two Things to Check
Client-side navigation. Most headless front ends are single-page applications, so navigation between pages does not reload the document. The Web SDK handles this automatically. See Tracking page views in single-page apps.
Preview environments. Headless setups usually run a preview or draft build on a separate hostname. Decide whether you want tracking there, since preview traffic is your own editorial team and mixes internal activity into your reporting. See Custom domains.
Next Steps
- Tracking page views in single-page apps: handling client-side route changes.
- Web SDK reference: full list of tracking methods and options.
- Cookie Consent installation: add the consent banner so it loads before other tracking scripts.
If you need further assistance, contact us at support@oursprivacy.com.
How is this guide?

