One domain, many subdomains
Plenty of websites run on more than one subdomain: the marketing site on www., the shop on shop., the product on app. You don't need a separate Measurebase domain for each of them. One domain covers the main domain and every subdomain of it.
How one domain covers every subdomain
- One snippet. The same Measurebase snippet works on every subdomain. Paste it on each one, or install the WordPress or Shopware plugin or the Shopify app there with the same domain.
- One tagging host. Your tagging subdomain, for example
mbase.example.com, serves all of them. No extra DNS record is needed. - One visitor, one session. The cookies sit on the main domain, so a visitor who moves from www. to shop. keeps one session in GA4. You don't need GA4's cross-domain setting for subdomains.
Setting it up
- Add the main domain. In the dashboard, add
example.com, notshop.example.com. Enter a subdomain and Measurebase names the main domain to use instead. - Put the snippet on every subdomain. Use the same snippet everywhere, or the plugin or app for the platform each subdomain runs on.
- Check Sites on this domain. Domain settings lists every subdomain that sent hits in the last 28 days, with its share of the hits and when the last one arrived.
- Mark staging sites. Choose Test or staging for subdomains like dev. or staging. Measurebase suggests it for names that look like one.
- Watch the subdomains you count on. Tick Alert if silent, or add a subdomain that is not sending yet. The tracking audit warns when it stays quiet.
Google Tag Manager
One web container for every subdomain is simplest. If a subdomain uses its own container, set the Google tag's server container URL there to your tagging host as well, for example https://mbase.example.com.
Staging and development sites
A staging site with the production snippet sends its visits, events and test orders into your real data, and GA4, Google Ads and Meta count them as real. Keep the snippet off staging sites, give them their own Measurebase domain, or exclude their hostnames with a GA4 data filter. The tracking audit warns when a subdomain marked as test sends hits, and its GA4 check no longer counts those hostnames as your own site.
Tagway on several subdomains
Tagway serves your tracking from a path on your own website, so Safari keeps the cookies for their full lifetime. Each subdomain needs the same forwarding: route /mb on shop.example.com to your tagging host just like on www.example.com, add https://shop.example.com under Tagway, Your other subdomains, and run its check.
With one web container for several subdomains, use a Lookup Table variable on Page Hostname as the Google tag's server container URL. Each subdomain maps to its own Tagway address, and the default value is your tagging subdomain. The dashboard shows the table for your addresses.
Ad click IDs across subdomains
A visitor often lands on www. and buys on shop. The Click ID Restorer keeps the click IDs it captures on the main domain, so they are still there when the conversion happens on another subdomain.
Frequently asked questions
When do I need a second Measurebase domain?
Only for a different main domain, like example-shop.com next to example.com. That one needs its own Measurebase domain, and GA4's cross-domain setting to keep sessions together.
Does the site crawl check my other subdomains?
Yes. The tracking audit's site crawl also visits the home page of up to two busy subdomains, so consent and scripts there are checked too.
Can each subdomain have its own GTM container?
Yes. Point the Google tag in each container at the same tagging host. The tracking audit reads the containers you link in the dashboard.