From 681904512dd0b9bb9608f8e871c4429a5fe788dc Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 10 Jul 2026 11:03:28 -0700 Subject: [PATCH 01/13] feat(landing): add HubSpot tracking script for hosted marketing site - Loads the HubSpot loader in the landing route group only, gated by isHosted - Not loaded for self-hosted/OSS deployments - Adds the loader's companion scripts (analytics, form-tracking, banner) and their beacon hosts to CSP, verified against the actual scripts' network calls --- apps/sim/app/(landing)/layout.tsx | 14 +++++++++++++- apps/sim/lib/core/security/csp.ts | 10 ++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/apps/sim/app/(landing)/layout.tsx b/apps/sim/app/(landing)/layout.tsx index 7e320fad1b8..631f4091b5d 100644 --- a/apps/sim/app/(landing)/layout.tsx +++ b/apps/sim/app/(landing)/layout.tsx @@ -1,8 +1,12 @@ import type { ReactNode } from 'react' import type { Metadata } from 'next' +import Script from 'next/script' +import { isHosted } from '@/lib/core/config/env-flags' import { SITE_URL } from '@/lib/core/utils/urls' import { LandingShell } from '@/app/(landing)/components' +const HUBSPOT_SCRIPT_SRC = 'https://js-na2.hs-scripts.com/246720681.js' as const + /** * Route-group layout for the entire landing family - the home page, platform and * solutions pages, pricing, legal, and the marketing subroutes (blog, models, @@ -24,5 +28,13 @@ export const metadata: Metadata = { } export default function LandingLayout({ children }: { children: ReactNode }) { - return {children} + return ( + + {children} + {/* HubSpot tracking code — hosted marketing site only, not self-hosted deployments */} + {isHosted && ( +