Skip to content

Commit f2e1ec8

Browse files
committed
refactor(growth): remove useTelemetryCookie and sb-telemetry-data cookie
The sb-telemetry-data cookie mechanism is fully superseded by the _sb_first_referrer edge cookie (GROWTH-625) and the in-memory first-touch store (GROWTH-656). Remove the hook definition, its export, the clearTelemetryDataCookie utility, its call in consent.tsx, and the TELEMETRY_DATA constant. GROWTH-646
1 parent 3b07e8d commit f2e1ec8

5 files changed

Lines changed: 2 additions & 47 deletions

File tree

packages/common/constants/local-storage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export const LOCAL_STORAGE_KEYS = {
111111
*/
112112
/** @deprecated – we're using usercentrics instead to handle telemetry consent */
113113
TELEMETRY_CONSENT: 'supabase-consent-ph',
114-
TELEMETRY_DATA: 'supabase-telemetry-data',
115114

116115
/**
117116
* DOCS

packages/common/hooks/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ export * from './useOnChange'
1313
export * from './useParams'
1414
export * from './useSearchParamsShallow'
1515
export * from './useFirstTouchStore'
16-
export * from './useTelemetryCookie'
1716
export * from './useThemeSandbox'

packages/common/hooks/useTelemetryCookie.tsx

Lines changed: 0 additions & 37 deletions
This file was deleted.

packages/common/telemetry-utils.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IS_PROD, LOCAL_STORAGE_KEYS } from './constants'
1+
import { IS_PROD } from './constants'
22
import { isBrowser } from './helpers'
33

44
export function getTelemetryCookieOptions() {
@@ -10,11 +10,6 @@ export function getTelemetryCookieOptions() {
1010
return isSupabaseCom ? 'path=/; domain=supabase.com; SameSite=Lax' : 'path=/; SameSite=Lax'
1111
}
1212

13-
export function clearTelemetryDataCookie() {
14-
if (!isBrowser) return
15-
document.cookie = `${LOCAL_STORAGE_KEYS.TELEMETRY_DATA}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; max-age=0; ${getTelemetryCookieOptions()}`
16-
}
17-
1813
// Parse session_id from PostHog cookie since SDK doesn't expose session ID
1914
// (needed to correlate client and server events)
2015
function getPostHogSessionId(): string | null {

packages/ui-patterns/src/consent.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import { clearTelemetryDataCookie, consentState, isBrowser } from 'common'
3+
import { consentState, isBrowser } from 'common'
44
import { useCallback, useEffect, useRef } from 'react'
55
import { toast } from 'sonner'
66
import { cn } from 'ui'
@@ -26,7 +26,6 @@ export const useConsentToast = () => {
2626
if (!isBrowser) return
2727

2828
snap.denyAll()
29-
clearTelemetryDataCookie()
3029

3130
// Clear GA4 and sGTM tracking cookies
3231
const trackingCookies = ['_ga', '_ga_XW18KGKGNR', 'FPID', 'FPAU', 'FPLC']

0 commit comments

Comments
 (0)