From aa6f1bfb00a6fee0fff73cd3457fe4013345b11a Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 9 Sep 2025 08:38:47 +0530 Subject: [PATCH] add: gtm. --- src/lib/system.ts | 9 +++++++++ src/routes/+layout.svelte | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lib/system.ts b/src/lib/system.ts index b9dab34d5..0e3408872 100644 --- a/src/lib/system.ts +++ b/src/lib/system.ts @@ -39,3 +39,12 @@ export function isMultiRegionSupported(url: URL): boolean { return false; } } + +// there can be multiple internal cloud instances. +export function isProductionCloud(url: URL): boolean { + try { + return url.hostname === 'cloud.appwrite.io'; + } catch { + return false; + } +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9e4279458..578404583 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -6,7 +6,7 @@ import { trackPageView } from '$lib/actions/analytics'; import { Notifications, Progress } from '$lib/layout'; import { app, type AppStore } from '$lib/stores/app'; - import { isCloud } from '$lib/system'; + import { isCloud, isProductionCloud } from '$lib/system'; import { onMount } from 'svelte'; import { requestedMigration } from './store'; import { parseIfString } from '$lib/helpers/object'; @@ -174,9 +174,10 @@ {/if} - - - + + {#if isCloud && isProductionCloud(page.url)} + + {/if}