Docs
← Back to site

Your own web app

1 min readUpdated November 11, 2026

Your own dashboard is a site too. Put your marketing site and your app on one site, so a visitor who comes from an ad to example.com, reads the pricing and signs up on app.example.com is one visit with one source:

One site for both
await stats.sites.upsert('product', { name: 'Product', domains: ['example.com', 'app.example.com'] });
// Later, add or remove a domain and keep the others:
await stats.sites.domains('product', { add: ['billing.example.com'] });

A move between a site’s own domains is never counted as a referral, and the visitor is the same person on both. Subdomains of a listed domain always count, so example.com alone covers app., billing. and every *.example.com; list another domain only when it is a different one.

Or keep them as linked sites#

When the app should keep its own stats, make it a site of its own and link the two. A visitor who goes from one to the other is followed (no cookies, the same day), and the visit in the app keeps where they first came from:

Linked sites
await stats.sites.upsert('product', { name: 'Product', domains: ['example.com'] });
await stats.sites.upsert('product-app', { name: 'Product app', domains: ['app.example.com'] });
await stats.sites.link('product', ['product-app']); // up to 10 sites; [] or unlink() undoes it

const report = await stats.sites.cross('product', '30d');
// report.sites[0]: { ref: 'product-app', wentOn: 120, share: 8.4, cameFrom: 15, sources: […], events: […], revenue: […] }

sites.links(ref) lists a site’s linked sites. The dashboard shows the same report as its Linked websites card.

Events and signed-in users#

Any client component
import { track, identify } from 'nahnu-analytics-sdk/next';

identify(user.id); // after sign-up or sign-in: one person across devices and domains
track('Project created', { props: { template: 'shop' } });
track('Upgraded', { revenue: { amount: 49, currency: 'USD' } });

An event becomes a goal when you add one with its name (Goals & events). Funnels work across these events and pages.

Was this helpful?