about summary refs log tree commit diff
path: root/src/Navigation.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-07-11 18:43:10 -0700
committerGitHub <noreply@github.com>2024-07-11 18:43:10 -0700
commit8b121af2e438ca77cc5f5b1715516107c18aff6f (patch)
treec7f1a28b63226c79e07aef4d2e88898358a62ec6 /src/Navigation.tsx
parent83e8522e0a89be28b1733f4c50dbd4379d98d03b (diff)
downloadvoidsky-8b121af2e438ca77cc5f5b1715516107c18aff6f.tar.zst
referrers for all platforms (#4514)
Diffstat (limited to 'src/Navigation.tsx')
-rw-r--r--src/Navigation.tsx15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx
index 495435122..8c815a3fe 100644
--- a/src/Navigation.tsx
+++ b/src/Navigation.tsx
@@ -31,7 +31,7 @@ import {
 } from 'lib/routes/types'
 import {RouteParams, State} from 'lib/routes/types'
 import {bskyTitle} from 'lib/strings/headings'
-import {isAndroid, isNative} from 'platform/detection'
+import {isAndroid, isNative, isWeb} from 'platform/detection'
 import {PreferencesExternalEmbeds} from '#/view/screens/PreferencesExternalEmbeds'
 import {AppPasswords} from 'view/screens/AppPasswords'
 import {ModerationBlockedAccounts} from 'view/screens/ModerationBlockedAccounts'
@@ -49,6 +49,7 @@ import {
   StarterPackScreenShort,
 } from '#/screens/StarterPack/StarterPackScreen'
 import {Wizard} from '#/screens/StarterPack/Wizard'
+import {Referrer} from '../modules/expo-bluesky-swiss-army'
 import {init as initAnalytics} from './lib/analytics/analytics'
 import {useWebScrollRestoration} from './lib/hooks/useWebScrollRestoration'
 import {attachRouteToLogEvents, logEvent} from './lib/statsig/statsig'
@@ -769,6 +770,18 @@ function logModuleInitTime() {
     initMs,
   })
 
+  if (isWeb) {
+    Referrer.getReferrerInfoAsync().then(info => {
+      if (info && info.hostname !== 'bsky.app') {
+        logEvent('deepLink:referrerReceived', {
+          to: window.location.href,
+          referrer: info?.referrer,
+          hostname: info?.hostname,
+        })
+      }
+    })
+  }
+
   if (__DEV__) {
     // This log is noisy, so keep false committed
     const shouldLog = false