Single vs Multi-Domain Behavior
1. Architecture Overview
The platform supports both Single-Domain and Multi-Domain deployments using a shared infrastructure model.
- Containers are the billing unit.
- Sites are the routing unit.
2. Single-Domain Setup
Scenario: A business tracks one website (example.com).
- Configuration:
- Container ID:
C-123 - Site ID:
S-ABC - Primary Host:
example.com
- Container ID:
- Routing:
Host: example.commaps directly toC-123viaROUTING_MAP.SITE_REGISTRYreturns config forexample.com.
- Cookie Scope:
Domain=example.com(First-party).
3. Multi-Domain Setup
Scenario: A business tracks multiple country sites (example.com, example.co.uk) or brands (brandA.com, brandB.com) feeding into the same sGTM container.
- Configuration:
- Container ID:
C-123(Shared) - Site 1 (
S-ABC):example.com - Site 2 (
S-XYZ):example.co.uk
- Container ID:
- Routing:
- Both hostnames map to
C-123inROUTING_MAP. - The Container is the shared resource for billing and GTM logic.
- Both hostnames map to
- Site Registry Resolution:
- Requests include
X-Public-Host(determined by Router/Loader). - Use
X-Public-Hostto look up the specific Site Config fromSITE_REGISTRY. - Allows
example.comto use Web GTM IDGTM-111andexample.co.ukto useGTM-222.
- Requests include
4. Shared vs. Isolated State
| State | Scope | Behavior |
|---|---|---|
| Billing / Plan Usage | Shared | All hits count toward the Container's plan limit. |
| Runtime Config (KV) | Shared | Modules enabled on the Container apply to all Sites. |
| GTM Container | Shared | All requests hit the same sGTM Docker instance. |
| Web GTM ID | Isolated | Can be configured per-Site in SITE_REGISTRY. |
| Sessions/Cookies | Isolated | Cookies are scoped to their respective domains. FPID is not shared cross-domain (by default). |
5. Cross-Subdomain Tracking
For shop.example.com and blog.example.com:
- Cookie Domain: Configured as
.example.cominSITE_REGISTRY. - Resolution:
- Requests from
shop.example.comuse the.example.comcookie scope. FPIDis shared.- User identity is preserved across subdomains automatically.
- Requests from