Set up Pathmap

Install tracking on your website or app, then check that your first event arrives.

Add your website

  1. Open your workspace and choose Add website or app → Website. Create a workspace first if prompted.
  2. Enter your hostname, such as www.example.com, and select Create site.
  3. Open Settings → Installation to find your site’s snippet and public site ID.

Install with the hosted script, WordPress plugin, or Google Tag Manager. For a React app built with Next.js, follow the Next.js steps.

Ask your coding agent to add Pathmap

Add your website in Pathmap, then open Settings → Installation and select Copy agent prompt. It includes the tracker for your site and instructions for adding it to your project.

Paste the prompt into your coding agent with your website project open. After you publish the change, check for your first pageview.

Install the hosted script

  1. Copy Hosted script from Settings → Installation. If you use the example below, replace YOUR_SITE_ID with the public site ID from your snippet.
  2. Add the snippet once to the shared <head> on the pages you want to track.
  3. If your site requires consent, connect your banner. Publish your changes and check for your first pageview.
Hosted script
<script async src="https://collect.pathmap.io/v1/pathmap.js"
  data-pathmap-site="YOUR_SITE_ID"></script>

By default, the script records the first page load and changes to the URL path. If your app handles every pageview itself, set data-pathmap-auto="false".

Install in Next.js

Add your website in Pathmap, then install the hosted script once in your shared layout or use the browser package.

  1. Install the packed @pathmap/browser module in your app. If you have the Pathmap source, build it with pnpm --filter @pathmap/browser build, then run pnpm pack in packages/browser and install the resulting .tgz in your app.
  2. Put the example in Analytics.tsx, replace YOUR_SITE_ID, and render <Analytics /> once in your root layout.
  3. If you have a consent banner, pass its current choices through initialConsent and call tracker.setConsent() whenever they change. Verify the installation from a page that uses the layout.
Next.js tracker
'use client'
import { useEffect } from 'react'
import { createPathmap } from '@pathmap/browser'

export function Analytics() {
  useEffect(() => {
    const tracker = createPathmap({
      siteId: 'YOUR_SITE_ID',
      endpoint: 'https://collect.pathmap.io',
    })
    return () => tracker.dispose()
  }, [])
  return null
}

Install on WordPress

Add your website in Pathmap first so you have a site ID to enter in WordPress.

  1. Download the Pathmap Analytics plugin for WordPress 6.3 or later.
  2. In WordPress, go to Plugins → Add New → Upload Plugin. Upload the ZIP and activate it.
  3. Open Settings → Pathmap in WordPress. Enter your public ID in Pathmap site ID. If you use a custom collector, enter its HTTPS base URL in Tracker endpoint.
  4. Save, then open a public page on your site and check that a pageview arrives.

See how WordPress pageviews and successful forms appear in Pathmap

Install with Google Tag Manager

Add your website in Pathmap to get the snippet for your tag.

  1. Create one Custom HTML tag in your web container and paste the hosted script from Settings → Installation.
  2. Set a page-load trigger for the pages you want to track. Pass current consent choices before the tag runs if your site uses a consent manager.
  3. Preview in Tag Assistant. Once you see the tag fire once per document, publish the container and check that Pathmap receives a pageview.

Install in a native app

  1. For an app on its own, choose Add website or app → Mobile app. To see web and app activity together, open Settings → Mobile apps for your existing site.
  2. Register the exact iOS bundle ID or Android package name from the build you’ll run, including any debug suffix.
  3. In Settings → Mobile apps, copy the Tracking ID and Collector URL. A site owner can select Create key beside the app and copy its native ingest key.

iOS 15 and later

Download the Swift package and unzip it. In Xcode, add the extracted folder as a local package. Link the PathmapMobile product to your app target.

iOS SDK
import Foundation
import PathmapMobile

let analytics = try PathmapAnalytics(
    endpoint: URL(string: "https://collect.pathmap.io/v1/mobile/events")!,
    siteID: trackingID,
    appID: bundleID,
    appVersion: releaseVersion,
    ingestKey: nativeIngestKey
)

await analytics.setAnalyticsConsent(analyticsAllowed)
try await analytics.startSession()
try await analytics.screen("home")
try await analytics.flushWithRetry()

Android

Download the Android SDK sources and unzip them. Copy PathmapAnalytics.java and PathmapMobile.kt to the matching Java and Kotlin packages in your app. Add the android.permission.INTERNET permission to your manifest.

Android SDK
import io.pathmap.analytics.PathmapMobile
import java.io.File
import java.net.URL

val analytics = PathmapMobile(
    URL("https://collect.pathmap.io/v1/mobile/events"),
    trackingId,
    applicationContext.packageName,
    BuildConfig.VERSION_NAME,
    nativeIngestKey,
    File(applicationContext.filesDir, "pathmap")
)

analytics.setConsent(analyticsAllowed)
analytics.foreground()
analytics.screen("home")
// Call from a background thread.
analytics.upload()

React Native and Expo

Download the React Native package and install it in your app. For Expo, add the Expo starter to supply persistent storage and UUID generation.

Expo installation
npm install ./pathmap-native-0.1.0.tgz
npx expo install expo-crypto expo-sqlite

Create one client with the collector URL ending in /v1/mobile/events, tracking ID, app identifier, version, and native ingest key. In React Native without Expo, provide durable storage and UUID generation. Pass consent to setConsent, record foreground starts and screens, and call flush to deliver queued events.

Check your first screen view

  1. Use your app’s tracking ID, version, identifier, and ingest key in the example. Set the visitor’s analytics consent before sending events and whenever it changes.
  2. Run the app with analytics consent granted and open a screen where you call screen. Use a reachable HTTPS collector on physical devices. Android emulators reach your computer at 10.0.2.2.
  3. Check the Latest version received and Last event columns in Settings → Mobile apps. Then open Mobile Analytics and look for the screen you sent.

Connect a website visit to an app action

Use an approved HTTPS app link

  1. Download the browser SDK package and install it alongside the tracker. Import nativeHandoffLink from @pathmap/browser/handoff. Pass the approved app link, the tracker, and options for the site ID, collector endpoint, platform, app ID, and current consent.
  2. Read the pm_app parameter from the link in your app. After app analytics consent, call recordFirstOpen(reference:) in Swift or firstOpen in Kotlin and React Native. Send the resulting event through the SDK.
  3. In Funnels, choose Web to app and a seven- or 30-day window. Start with a Web step and choose the relevant app platform for the later steps.

Follow a signed-in account with React Native or Expo

  1. Enable consented profiles. Keep a profiles:ingest key and an opaque account ID on your trusted backend. After web sign-in, bind the eligible visit context using POST /v1/profiles/bind.
  2. After native sign-in and app analytics consent, start the app session and obtain accountSessionProof(). Send the proof to your backend. Have the backend post the site ID, platform, app ID, proof, and the same opaque subject to /v1/profiles/native/bind.
  3. Build a Web to app funnel that counts accounts. End the active binding on sign-out or account switch using /v1/profiles/native/sign-out, then bind the next eligible account after sign-in.

Compare the two sample funnels.

Verify your website installation

Confirm a production pageview

  1. Open a regular page on your tracked site and grant analytics consent if prompted.
  2. In Pathmap, go to Settings → Installation → Verify installation and select Check for signal.
  3. Look for Production pageview received with the hostname and time of your visit. Select View overview to see the report.

Run a Tracking tester session

  1. In Settings → Installation → Tracking tester, select Create test session.
  2. Enter the full URL in Page URL for testing, then select Open test page. Use the generated link within 15 minutes and grant consent if prompted.
  3. Return to the tester and look for Signal received. The tester records activity in diagnostics only.

If you’re still waiting for a signal

  • Wrong hostname. Check the exact hostname in Settings → Tracking → Allowed hostnames, including any www or staging subdomain.
  • Consent pending. Check that your banner passes the current choices and that you granted the required consent.
  • Still waiting. Confirm the page loads the script, its site ID matches the one in Installation, and your browser can reach the collector.

Track actions and confirmed outcomes

  1. To record a button click, add data-pathmap-event="pricing_cta_clicked" to the button.
  2. To record a completed signup, call the example function from your signup success handler after the tracker loads.
  3. Perform the action on a regular page. Check Settings → Event catalog for the event, then add it to a funnel with the steps that lead up to it.
Signup event
async function recordCompletedSignup() {
  const tracker = window.pathmap
  if (!tracker) return
  await tracker.ready
  tracker.track('signup_completed')
}

For an accepted enquiry in a same-visit funnel, use Event catalog → Verified outcomes. Send the confirmation from your backend with the outcome’s scoped key, a stable event ID, and the original confirmation time. Select the outcome as the final funnel step to see the confirmed total and the share linked to eligible, consenting visits.

Set up lead attribution for a website form · Try the sample lead report

Measure engagement and revenue

  • Engagement. Enable the signals you need under Settings → Tracking. Contact clicks record the link type, and form events record a submission attempt. Add data-pathmap-404 to your 404 template to record visits to missing pages.
  • Revenue. Send a receipt from your backend when a payment is confirmed. To link the receipt to an eligible visit, call await window.pathmap.attributionContext() after consent and pass the returned value to your checkout backend.

Connect your checkout with the Payments API

Use a manual payment connection for a custom checkout. Send the setup requests from the Pathmap app origin with a signed-in site owner session. Use the site’s UUID for {siteId} and the ID returned by the connection request for PAYMENT_CONNECTION_ID.

Connection and key setup
POST /api/app/sites/{siteId}/payment-connections
{
  "provider": "manual",
  "accountId": "storefront",
  "label": "Website checkout"
}

POST /api/app/sites/{siteId}/keys
{
  "paymentConnectionId": "PAYMENT_CONNECTION_ID",
  "label": "Checkout backend"
}
  1. When a consenting visitor starts checkout, call await window.pathmap.checkoutReference(connectionId) after the tracker is ready. Save any returned reference with the order.
  2. After payment succeeds, send a capture from your backend to https://collect.pathmap.io/v1/payments with the connection key in the Authorization: Bearer header. Use the payment’s original time and minor units. Keep the key on your server. Omit checkoutReference if checkout returned no reference.
  3. Send a successful refund as type: "refund" with the original paymentId, a stable refundId, and its own event ID, time, currency, and amount. Reuse the same ID and payload on retry.
Paid order payload
{
  "type": "capture",
  "eventId": "order_paid_42",
  "paymentId": "order_42",
  "occurredAt": "2026-11-27T08:00:00.000Z",
  "currency": "USD",
  "amountMinor": "10000",
  "checkoutReference": "SAVED_CHECKOUT_REFERENCE"
}

Open Revenue in Overview to check the captured amount, refunds, and net revenue. Payments without a visit link appear in the site-wide totals.

See a sample revenue report

Import historical traffic

  1. In Settings → Imports, choose Plausible, GA4, or CSV.
  2. Upload the file and select Validate import. For a GA4 CSV, use one row per date with Date, Sessions, Total users or Active users, and Views.
  3. If you see Connect Google Analytics, you can also grant read-only access and preview an import for completed dates from a property you manage.
  4. Select Review import. Check the date range, reporting timezone, and available fields, then select Apply import. Pathmap uses its own recorded data first on overlapping dates.

See the supported formats and try a sample import

Connect reporting integrations

  • Search Console. In Settings → Search Console, connect and select a property you can access that covers your site’s hostname.
  • Slack. If your workspace has the Slack adapter, set up report deliveries in Settings → Reports.
  • Stats API or MCP. Create a site-scoped Stats key in Settings → Data controls.

Share an Overview or schedule a report

  1. Open Shared views in site settings and choose Public overview. Set the date range or filters the recipient can read.
  2. Set the expiration, optionally require a password, and choose whether to allow CSV downloads before creating the link.
  3. For a recurring summary, open Settings → Reports and choose a weekly or monthly delivery, with a configured email or Slack destination.

In your workspace, use the CSV action in Overview to download the current report. Try the dashboard example.

Use the API or connect an MCP client

In site settings, create an Events API key under Access for backend writes. Create a Stats key under Data controls for site reads, or a workspace Stats token that names the sites it can read. Keep these keys on your backend or in the authorized client.

Send events to the collector at POST /v1/events. Query aggregates on your API origin at POST /v1/stats/query or open Stats API playground in site settings. For MCP, use /mcp on that API origin with a Stats key or complete the client’s OAuth site or workspace authorization.

Try the event, Stats API, and MCP example

Install and authorize the CLI

Download the Pathmap CLI package and install it in a local Node.js project. Set PATHMAP_API_URL to your Pathmap API origin.

CLI setup
npm install ./pathmap-cli-0.1.0.tgz
npx pathmap login --scope stats:read --json

Complete authorization in your browser. Store the returned access token securely and set PATHMAP_ACCESS_TOKEN when running report commands. Use the public site ID with --site and select the date range with --from and --to.

Configure an export destination

When an export destination is configured for your installation, open Scheduled raw exports in site settings to choose event or session data, format, and cadence. Use an initial backfill for available dates within the site’s retention window.

Serve the tracker from your own domain

Forward a fixed prefix such as /analytics on your site to the collector. Forward only approved tracker routes, preserve the browser’s Origin header, and strip credentials at the proxy.

Set the snippet’s source to /analytics/v1/pathmap.js, then verify the installation through the new URL.