diff --git a/src/services/analytics/gtm.ts b/src/services/analytics/gtm.ts index cbd4029111..fe77d3b26c 100644 --- a/src/services/analytics/gtm.ts +++ b/src/services/analytics/gtm.ts @@ -21,6 +21,7 @@ import { EventType, DeviceType } from './types' import { SAFE_APPS_SDK_CATEGORY } from './events' import { getAbTest } from '../tracking/abTesting' import type { AbTest } from '../tracking/abTesting' +import { AppRoutes } from '@/config/routes' type GTMEnvironment = 'LIVE' | 'LATEST' | 'DEVELOPMENT' type GTMEnvironmentArgs = Required> @@ -155,6 +156,10 @@ export const normalizeAppName = (appName?: string): string => { } export const gtmTrackSafeApp = (eventData: AnalyticsEvent, appName?: string, sdkEventData?: SafeAppSDKEvent): void => { + if (!location.pathname.startsWith(AppRoutes.apps.index)) { + return + } + const safeAppGtmEvent: SafeAppGtmEvent = { ...commonEventParams, event: EventType.SAFE_APP,