• 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.

Tracking

Page addresses

Replace the IDs and names in your page addresses before they leave the browser, so reports group pages by route and hold no personal data.

Many apps put IDs and names in their page addresses, such as /orders/8412 or /team/jane. Each one then shows up as its own page in your reports, and the address can tell who the visitor is. Give the script a url function to replace them in the browser, before anything leaves it.

Add the function#

The function gets each address the script is about to send and returns the one to send in its place.

Set it in a line above the snippet.

HTML
<script>window.ultanimus = { url: (url) => url.replace(/\/orders\/\d+/, '/orders/[id]') }</script>
<script defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID"></script>

If you also use the queue line from Custom events, add url to the same object.

Pass it to Analytics.

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

A function cannot pass from a server component to the browser. Render Analytics in a client component, and put that component in your root layout.

app/tracking.tsx
'use client'

import { Analytics } from '@ultanimus/next'

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

Pages then group by route in your reports: /orders/[id] counts every order page together.

What it gets#

The function runs on every event the script sends: pageviews, custom events, link clicks, page loads, web vitals and errors. On the first event of each page load, it also gets the address the visitor came from, which can be another site's.

  • Return an address, and it goes out in place of the real one.
  • Return null for the page, and the event is not sent.
  • Return null for the referrer, and the event goes out without one.

If the function throws, the event is not sent and your page carries on.

Return a full address on your own domain, as you got it. Events from another domain do not count, with or without the function.

Keep campaign tags#

Campaign tags such as utm_source sit in the query string and decide where a visit came from, so never drop the whole query string. To drop a private parameter, such as a reset token, remove that parameter alone:

JavaScript
url: (url) => url.replace(/([?&])token=[^&#]*&?/, '$1')

Goals, funnels and rules#

Goals, funnels and excluded pages see the address the function returned. Write their patterns against it, such as /orders/[id].

An excluded page still sends its address, and the server drops it on arrival. When an address must never leave the browser, change it here.

PreviousExcluded pagesNextShare links and embeds

On this page

  • Add the function
  • What it gets
  • Keep campaign tags
  • Goals, funnels and rules
View as Markdown