• 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

React

The Analytics component and track() for React apps.

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

The React package works in any React app, with or without a framework. Other frameworks shows where the component goes in TanStack Start and React Router.

Install the package#

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

Add the component#

Render Analytics once, near the root of your app.

App.tsx
import { Analytics } from '@ultanimus/react'

export function App({ children }) {
  return (
    <>
      {children}
      <Analytics site="YOUR_SITE_ID" />
    </>
  )
}

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, paste the script tag into the <head> of your index.html, or of your root layout in a framework, and send events with window.ultanimus?.track().

Page weight#

Add load to measure what one page load in ten downloads, for the Load page. A number from 1 to 100 sets another share.

TSX
<Analytics site="YOUR_SITE_ID" load />

Web vitals#

Add vitals to measure LCP, INP and CLS on real page loads, for the Web vitals page. It measures every page load; a number from 1 to 100 sets a share.

TSX
<Analytics site="YOUR_SITE_ID" vitals />

Errors#

Add errors to report the JavaScript errors visitors run into, for the Errors page. The component adds the script after the page mounts, so errors thrown before that are missed. Put the script tag in your HTML instead to catch those too.

TSX
<Analytics site="YOUR_SITE_ID" errors />

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.

Send an event#

Call track with a name and, if you want, properties.

TSX
import { track } from '@ultanimus/react'

track('signup', { plan: 'pro' })

Custom events covers naming and properties.

Signed-in users#

Pass your own ID for the signed-in person, or null when nobody is, and they count as one visitor across days and devices.

TSX
<Analytics site="YOUR_SITE_ID" user={session?.userId ?? null} />

Signed-in users explains what changes and what is stored.

IDs in page addresses#

Pass url to replace the IDs and names in your page addresses before they leave the browser. Page addresses covers what the function gets and returns.

TSX
<Analytics site="YOUR_SITE_ID" url={(url) => url.replace(/\/orders\/\d+/, '/orders/[id]')} />

Outbound links and downloads#

Add outbound to record clicks on links to other sites, and downloads for clicks on files. Links and downloads lists what counts.

TSX
<Analytics site="YOUR_SITE_ID" outbound downloads />
PreviousNext.jsNextReact Native and Expo

On this page

  • Install the package
  • Add the component
  • Without the package
  • Page weight
  • Web vitals
  • Errors
  • Content Security Policy
  • Send an event
  • Signed-in users
  • IDs in page addresses
  • Outbound links and downloads
View as Markdown