Skip to content

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
  • Routing:
    • Host: example.com maps directly to C-123 via ROUTING_MAP.
    • SITE_REGISTRY returns config for example.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
  • Routing:
    • Both hostnames map to C-123 in ROUTING_MAP.
    • The Container is the shared resource for billing and GTM logic.
  • Site Registry Resolution:
    • Requests include X-Public-Host (determined by Router/Loader).
    • Use X-Public-Host to look up the specific Site Config from SITE_REGISTRY.
    • Allows example.com to use Web GTM ID GTM-111 and example.co.uk to use GTM-222.

4. Shared vs. Isolated State

StateScopeBehavior
Billing / Plan UsageSharedAll hits count toward the Container's plan limit.
Runtime Config (KV)SharedModules enabled on the Container apply to all Sites.
GTM ContainerSharedAll requests hit the same sGTM Docker instance.
Web GTM IDIsolatedCan be configured per-Site in SITE_REGISTRY.
Sessions/CookiesIsolatedCookies 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.com in SITE_REGISTRY.
  • Resolution:
    • Requests from shop.example.com use the .example.com cookie scope.
    • FPID is shared.
    • User identity is preserved across subdomains automatically.

Released under proprietary license.