How multi-site reporting works

Each site is a small configuration object with an ID, display name, GA4 property ID, and Telegram chat destination. The runner can send all reports or only one selected site.

Multi-site configuration

sites JavaScript
sites: [
  {
    id: "marketing",
    name: "Marketing Site",
    ga4PropertyId: "111111111",
    telegramChatId: process.env.TELEGRAM_CHAT_ID
  },
  {
    id: "docs",
    name: "Docs",
    ga4PropertyId: "222222222",
    telegramChatId: process.env.DOCS_TELEGRAM_CHAT_ID
  },
  {
    id: "app",
    name: "App",
    ga4PropertyId: "333333333",
    telegramChatId: process.env.APP_TELEGRAM_CHAT_ID
  }
]

Run one site or all sites

In a Vercel route, request ?site=all to report every site or ?site=docs to report only one. In a plain Node.js runner, pass the site ID through your own script arguments.

  • site=all: send every configured report.
  • site=marketing: send only the marketing site report.
  • No site parameter: use the default configured behavior.

Team usage patterns

Small teams often send all websites to one private Telegram group. Agencies may prefer a separate chat per client or product. Both patterns work because each site can define its own chat ID.

Keep GA4 access narrow. Add the reporting service account only to the properties it needs to read.

Related guides