@@ -6,9 +6,18 @@ import { isHosted } from '@/lib/core/config/env-flags'
66import { SITE_URL } from '@/lib/core/utils/urls'
77import { LandingShell } from '@/app/(landing)/components'
88import { HubspotPageViewTracker } from '@/app/(landing)/hubspot-page-view-tracker'
9+ import { XPageViewTracker } from '@/app/(landing)/x-page-view-tracker'
910
1011const HUBSPOT_SCRIPT_SRC = 'https://js-na2.hs-scripts.com/246720681.js' as const
1112
13+ const X_PIXEL_ID = 'q5xbl' as const
14+
15+ /** X (Twitter) conversion tracking base code — loads uwt.js and fires the initial PageView. */
16+ const X_PIXEL_BASE_CODE = `!function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments);
17+ },s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='https://static.ads-twitter.com/uwt.js',
18+ a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script');
19+ twq('config','${ X_PIXEL_ID } ');`
20+
1221/**
1322 * Route-group layout for the entire landing family - the home page, platform and
1423 * solutions pages, pricing, legal, and the marketing subroutes (blog, models,
@@ -33,12 +42,16 @@ export default function LandingLayout({ children }: { children: ReactNode }) {
3342 return (
3443 < LandingShell >
3544 { children }
36- { /* HubSpot tracking — hosted only */ }
45+ { /* HubSpot + X pixel tracking — hosted only */ }
3746 { isHosted && (
3847 < >
3948 < Script id = 'hs-script-loader' src = { HUBSPOT_SCRIPT_SRC } strategy = 'afterInteractive' />
49+ < Script id = 'x-pixel-base' strategy = 'afterInteractive' >
50+ { X_PIXEL_BASE_CODE }
51+ </ Script >
4052 < Suspense fallback = { null } >
4153 < HubspotPageViewTracker />
54+ < XPageViewTracker />
4255 </ Suspense >
4356 </ >
4457 ) }
0 commit comments