diff --git a/apps/console/src/lib/utils/analytics.ts b/apps/console/src/lib/utils/analytics.ts index 02672e18..b0342d5c 100644 --- a/apps/console/src/lib/utils/analytics.ts +++ b/apps/console/src/lib/utils/analytics.ts @@ -65,7 +65,9 @@ export const useIdentify = (user: GetMeQuery["me"]) => { const window = (global as any).window; // GTM data layer - window.dataLayer.push({ ...identifyRequest }); + if (window.dataLayer) { + window.dataLayer.push({ ...identifyRequest }); + } }, [user, organizationId, projectId]); };