• 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

Other frameworks

Add the script or the React component to TanStack Start, React Router, SvelteKit, Nuxt, Astro, Vite, Angular, Laravel, Rails and more.

Every framework below takes the same one-line script, or the React component when it runs on React. Add it once, in your site's main layout. The script counts a pageview each time the router changes the address, so client-side navigation needs no extra code.

Tip

The CLI can do it for you. npx @ultanimus/cli init finds TanStack Start, React Router, SvelteKit, Nuxt, Astro, Vite and Angular projects and adds the code.

Note

Apps that route by hash count too. An address like /#/pricing shows up in your reports as the page /#/pricing. A plain anchor like /docs#install still counts as /docs.

React frameworks#

TanStack Start and React Router run on React, so use the React package. It gives you the component and a typed track().

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

TanStack Start#

Render Analytics once in the root route, inside <body>.

src/routes/__root.tsx
import { Analytics } from '@ultanimus/react'

function RootDocument({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <head>
        <HeadContent />
      </head>
      <body>
        {children}
        <Analytics site="YOUR_SITE_ID" />
        <Scripts />
      </body>
    </html>
  )
}

React Router#

Render Analytics once in the root Layout, inside <body>. Remix 2 apps use the same file.

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

export function Layout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <head>
        <Meta />
        <Links />
      </head>
      <body>
        {children}
        <ScrollRestoration />
        <Scripts />
        <Analytics site="YOUR_SITE_ID" />
      </body>
    </html>
  )
}

React lists the component's props.

SvelteKit#

Paste the script into src/app.html, inside <head> and above %sveltekit.head%.

src/app.html
<head>
  <meta charset="utf-8" />
  <script defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID"></script>
  %sveltekit.head%
</head>

Nuxt#

Add the script to app.head in your Nuxt config. Nuxt renders it on every page.

nuxt.config.ts
export default defineNuxtConfig({
  app: {
    head: {
      script: [{ src: 'https://cdn.ultanimus.com/s.js', defer: true, 'data-site': 'YOUR_SITE_ID' }],
    },
  },
})

Astro#

Paste the script into the <head> of the layout your pages share. is:inline tells Astro to leave the tag as it is instead of bundling it. With <ClientRouter />, the tag stays in place across navigations and counts each one.

src/layouts/Layout.astro
<head>
  <meta charset="utf-8" />
  <script is:inline defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID"></script>
</head>

Vite#

For a Vue, Svelte, Solid or Preact app built with Vite, paste the script into index.html at the project root. A React app can use the React component instead.

index.html
<head>
  <meta charset="UTF-8" />
  <script defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID"></script>
</head>

Angular#

Paste the script into src/index.html, inside <head>.

React Native and Expo#

iOS and Android apps use the React Native package instead of the script. On Expo web it loads the script for you.

Swift#

iPhone and iPad apps built with SwiftUI or UIKit use the Swift package.

Server-rendered and static sites#

Paste the script once, into the <head> of the base template your other templates extend. The usual file:

FrameworkFile
Laravelresources/views/layouts/app.blade.php
Railsapp/views/layouts/application.html.erb
Djangotemplates/base.html
HugoYour theme's baseof.html or head partial
Jekyll_includes/head.html
EleventyThe base layout in _includes

Send events#

React apps import track from the package. Everywhere else, the script adds window.ultanimus.track. Call it from a click or submit handler:

TypeScript
window.ultanimus?.track('signup', { plan: 'pro' })

The ?. skips the call when the script has not loaded, for example when an ad blocker stopped it. In TypeScript, declare the global once, such as in src/app.d.ts in SvelteKit:

TypeScript
declare global {
  interface Window {
    ultanimus?: { track: (name: string, props?: Record<string, string | number | boolean>) => void }
  }
}

export {}

Custom events covers names, properties and a queue for events sent before the script loads.

Check that it works#

Open your site, then your dashboard. The install check turns live with the first visit. If it keeps waiting, Script tag lists what to check.

Next steps#

  • If your site sends a Content Security Policy, allow the tracker's domain.
  • Pass the signed-in user, so one person counts once across days.
  • Record outbound links and downloads with data-outbound and data-downloads.
  • Script tag lists every attribute the snippet takes.
PreviousSwiftNextServer

On this page

  • React frameworks
  • TanStack Start
  • React Router
  • SvelteKit
  • Nuxt
  • Astro
  • Vite
  • Angular
  • React Native and Expo
  • Swift
  • Server-rendered and static sites
  • Send events
  • Check that it works
  • Next steps
View as Markdown