Skip to content
Tracking and technical

What is subdomain tracking?

2 min read · Updated · By the Reveata team

Short answerSubdomain tracking means measuring several subdomains of one domain, such as www.example.com, blog.example.com and app.example.com, as a single website, so a person who moves between them stays one visitor with one visit and one traffic source.

Most products live on more than one host. The marketing site is on www, the blog on blog, documentation on docs and the product itself on app. If each counts visitors separately, the journey that matters, from a blog post to a paid account, is cut into pieces and the post never gets credit.

Subdomains versus separate domains

blog.example.com and app.example.com share the root domain example.com. A cookie can be set on that root so every subdomain reads it. example.com and example-app.io are different root domains, and browsers keep them apart; joining them needs cross-domain tracking.

How it works in Reveata

There is nothing to set up. One Reveata website covers its domain and every subdomain of it, so the same snippet counts visits on example.com, www.example.com, app.example.com and any other *.example.com host (Track subdomains).

The script stores its visitor and session ids in first-party cookies on the broadest domain the browser accepts. For app.example.com that is example.com; for shop.example.co.uk it is example.co.uk. Every subdomain reads the same cookies, so the reader of your blog who signs up in your app is one visitor with one visit, and their payment is credited to the post or ad that brought them.

In cookieless mode no ids are stored, but the server's daily id is the same on every subdomain on the same day, so visits still join up within a day.

Seeing each subdomain

  • The Pages panel has a Hostname tab listing each host with its visitors, and revenue once payments are connected.
  • A filter such as Hostname is app.example.com narrows the whole dashboard, revenue included (Filters and segments).
  • The Page tab shows paths only, so / on two hosts is counted together. Filter on a hostname first when you want one subdomain's pages.

Leaving out staging and previews

Staging and preview hosts often load the production snippet. Add them under Settings → General → Exclusions → Exclude host names, one per line, with * for patterns such as *.preview.example.com. Every other subdomain stays counted (Exclusions).

One website or several?

Situation Use
Marketing site, docs, blog and app of the same product One website, so revenue is credited across them
Separate products with separate audiences Separate websites
A client site you manage on your own subdomain Usually a separate website, with its own team access

Each website has its own snippet, goals, payments and team access.

Frequently asked questions

Do I need a different snippet for each subdomain?

No. Paste the same snippet, with the same tracking id, on every subdomain you want counted.

Why is a subdomain missing from my reports?

Check that its pages load the snippet and that the host is not in your excluded host names. A page on a host outside your domain, its subdomains and its additional domains is refused, and the install check says which host sent it.

Will traffic between my subdomains show as referrals?

No. The subdomains share the same session cookie, so moving between them continues the same visit and the original source keeps the credit.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
GlossaryWhat is cross-domain tracking?Cross-domain tracking links a visitor's activity across two or more websites with different root domains, such as example.com and example-app.io, so the move from one to the other continues the same visit and keeps its original source instead of starting over as a new visitor.GlossaryWhat is a first-party cookie?A first-party cookie is a small piece of data stored by the website shown in the address bar, on that site's own domain. Only that site can read it, which is why it is used for sign-in sessions, shopping baskets and first-party analytics.GlossaryWhat are Core Web Vitals?Core Web Vitals are three measurements Google uses to describe a page's real-world user experience, namely Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness) and Cumulative Layout Shift (visual stability).GlossaryWhat are event properties?Event properties are key–value details attached to an analytics event, such as the plan chosen or the button clicked on a signup event, so you can break one event down by those details instead of creating a separate event for every variation.GlossaryWhat is a canonical URL?A canonical URL is the one preferred address you want search engines to index and show for a page whose content is reachable at several URLs, usually declared with a rel="canonical" link in the page's head.GlossaryWhat is a Content Security Policy (CSP)?A Content Security Policy (CSP) is a set of rules a website sends to the browser, usually in a Content-Security-Policy header, listing which sources of scripts, styles, images and network connections the page is allowed to use, so injected or unexpected code is blocked.