Tracking across subdomains
Track a site that spans several subdomains, such as www, app, blog or shop, and understand how Muro counts visitors across them.
If your product lives on more than one subdomain, such as example.com, app.example.com and blog.example.com, you can track them in one Muro project or in separate ones. This page explains how each option counts, so you can pick the one that fits.
How Muro counts across subdomains
The snippet identifies a project by its data-project-id, not by domain, so the same snippet works on any subdomain. Three things to know:
- Visitors are counted per project, across subdomains. Muro identifies visitors on its servers, not in browser storage, so the same person on
blog.example.comand thenapp.example.comin one project counts as one visitor. - Sessions cross subdomains. Moving from
blogtoappwithin 30 minutes continues the same session in Sessions. - The other subdomain shows up as a referrer. Muro only ignores referrers that match the current hostname exactly. A visitor who clicks from
blog.example.comtoapp.example.comshowsblog.example.comas the referrer on the app.
If both www.example.com and example.com serve your site, redirect one to the other so all visits land on a single hostname and neither shows up as a referrer for the other.
Separate projects never share visitors or sessions.
Option 1: one project for everything
Use the same snippet, with the same project ID, on every subdomain.
Good for: a combined total of traffic to your whole product, with one dashboard and one daily digest.
Keep in mind:
- Muro records the path of each page, not its hostname.
/pricingonexample.comand/pricingonapp.example.comare reported as the same page. Goals match on paths too. - Visitors and sessions are shared across subdomains, so one person moving between them counts once.
This works best when each subdomain uses different paths, for example a marketing site at /, /pricing and /blog/... and an app at /dashboard/....
Option 2: one project per subdomain
Create a separate project for each subdomain and install each project's own snippet. To add one, use the project switcher → New project. There's no limit on websites on any plan.
Good for: separate numbers for your marketing site, app and blog, with pages and goals that never collide.
Keep in mind: there's no combined total. Use Overview to see every project side by side.
Set it up
Decide which option you want
Pick one project for everything, or one project per subdomain.
Copy the snippet
For each project, open Settings → Project → Tracking script and click Copy script.
Add it to each subdomain
Paste the snippet into the <head> of every page on each subdomain. If a subdomain is a separate app or site builder, it needs its own install. See Install Muro.
Check your Content Security Policy
If any subdomain sets a Content Security Policy, allow Muro on it. See Fix Content Security Policy errors.
Verify it works
- Open a page on each subdomain with DevTools → Network filtered to
collect. Each one sends aPOSTtohttps://cdn.muroanalytics.com/collectwith status202. - Check the
project_idin each request's Payload matches the project you intended. - Set the dashboard time range to Live. Visits from each subdomain appear within a minute or so.