• Product

    • FeaturesFunnels, alerts, AI traffic and imports.
    • Live mapVisitors on a globe as they arrive.
    • SpeedA script under 1 KB. Visits in a second.
    • Integrations26 tools, from Slack to WordPress.
    • MCP serverAI tools set up sites and dashboards.

    Get started

    • Quick startOne script tag, and visits show up.
    • With an AI agentOne prompt, and your agent adds it.
    • API and CLIYour numbers in scripts and CI.
    • Install guides
      • Script tag
      • Next.js
      • React
      • Website builders
    Live demoacme.devLast 30 daysVisitors1,49325.5%PageVisitors/612/pricing341/docs/install208Click around before you sign up.Open the demoCompareHow we stack up against Google Analytics, Plausible, Fathom, PostHog and Umami
  • Company

    • AboutWhy it exists and how it is built.
    • BlogPrivacy, speed and how we build.
    • ContactQuestions on plans, setup or privacy.
    • BrandThe logo, colors, type and files.

    Trust

    • PrivacyWhat we collect and why.
    • TermsPlans, limits and your data.
    • StatusWhether everything is up right now. (opens in a new tab)
    Latest post4checks before DirectWhere Direct traffic comes fromNov 11, 2026Read the post
  • Blog
  • Docs
  • Pricing
Sign inStart free
FeaturesDemoSpeedBlogDocsPricing
Start freeSign in

Free for three sites. No card needed.

Getting started

  • Introduction
  • Quick start
  • Set up with an AI agent
  • CLI
  • CLI guide
  • How counting works

Install

  • Script tag
  • Next.js
  • React
  • React Native and Expo
  • Swift
  • Other frameworks
  • Server
  • Website builders

Mobile

  • Mobile apps
  • Screens and events
  • Swift apps
  • Development builds
  • Visitors and offline
  • App Store and Play privacy

Dashboard

  • Overview and filters
  • Custom dashboards
  • Realtime
  • Events page
  • Explore
  • Segments
  • Sessions
  • People
  • Journeys
  • Retention
  • Load
  • Web vitals
  • Errors
  • Revenue
  • Search Console
  • Visibility
  • Data quality
  • Transfer a site
  • Import and export
  • Scheduled reports

Tracking

  • Custom events
  • Signed-in users
  • Links and downloads
  • Goals and funnels
  • Alerts
  • Annotations
  • Excluded pages
  • Page addresses
  • Share links and embeds
  • Sitemaps

API

  • Overview
  • Query API
  • Load and vitals
  • Raw export
  • Live stream
  • MCP server

Platform

  • Architecture
  • Privacy and data

Getting started

  • Introduction
  • Quick start
  • Set up with an AI agent
  • CLI
  • CLI guide
  • How counting works

Install

  • Script tag
  • Next.js
  • React
  • React Native and Expo
  • Swift
  • Other frameworks
  • Server
  • Website builders

Mobile

  • Mobile apps
  • Screens and events
  • Swift apps
  • Development builds
  • Visitors and offline
  • App Store and Play privacy

Dashboard

  • Overview and filters
  • Custom dashboards
  • Realtime
  • Events page
  • Explore
  • Segments
  • Sessions
  • People
  • Journeys
  • Retention
  • Load
  • Web vitals
  • Errors
  • Revenue
  • Search Console
  • Visibility
  • Data quality
  • Transfer a site
  • Import and export
  • Scheduled reports

Tracking

  • Custom events
  • Signed-in users
  • Links and downloads
  • Goals and funnels
  • Alerts
  • Annotations
  • Excluded pages
  • Page addresses
  • Share links and embeds
  • Sitemaps

API

  • Overview
  • Query API
  • Load and vitals
  • Raw export
  • Live stream
  • MCP server

Platform

  • Architecture
  • Privacy and data

Cookieless web and product analytics. Fast to load, fast to read.

Start free, no card needed

Product

FeaturesLive mapDemoTry it on your siteSpeedPricingCompare

Get started

InstallDocsQuestionsSign inStart freeJoin the waitlist

Company

AboutBlogContactStatus (opens in a new tab)Brand

Legal

Privacy policyTerms of service

© 2026 Ultanimus. This site sets no cookies.

Install

Next.js

Install the Next.js package and render the Analytics component once, in your root layout.

0:30Watch insteadInstall with the Next.js packageOn YouTube (opens in a new tab)

The Next.js package adds the script for you from your root layout.

Install the package#

bun add @ultanimus/next
npm install @ultanimus/next
pnpm add @ultanimus/next
yarn add @ultanimus/next

Add the component#

Render Analytics once, in the root layout, with your site ID.

app/layout.tsx
import { Analytics } from '@ultanimus/next'

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Analytics site="YOUR_SITE_ID" />
      </body>
    </html>
  )
}

Open your site, and the install check on your dashboard turns live with the first visit.

Tip

Use the component or the script tag, not both. A second copy on the same page counts nothing, and your site's settings show a note until you remove it.

Without the package#

The package is under 1 KB with no dependencies. It loads the same script as the snippet and adds a typed track(). To skip it, put the script tag in the <head> of your root layout instead:

app/layout.tsx
export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head>
        <script defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID"></script>
      </head>
      <body>{children}</body>
    </html>
  )
}

Then send events with window.ultanimus?.track(), as Custom events shows.

Content Security Policy#

If your site sends a Content Security Policy, add the tracker's domain to script-src and connect-src, or the browser blocks the script:

Text
script-src 'self' https://cdn.ultanimus.com
connect-src 'self' https://cdn.ultanimus.com

Script tag explains where the policy usually lives.

Next steps#

  • Send custom events for signups and purchases.
  • Pass the signed-in user with the user prop, so one person counts once across days.
  • Record outbound links and downloads with the outbound and downloads props.
  • Measure page weight with the load prop, and see what to fix first on the Load page.
  • Measure Core Web Vitals with the vitals prop, and see which elements slow your pages.
  • Catch JavaScript errors with the errors prop, grouped by cause with the stack and the pages they break.
  • Keep IDs out of page addresses with the url prop, from a client component.
  • Send events from your server for anything confirmed on the backend.
PreviousScript tagNextReact

On this page

  • Install the package
  • Add the component
  • Without the package
  • Content Security Policy
  • Next steps
View as Markdown