Commit Graph
5 Commits
Author SHA1 Message Date
Sean Oliver 571533482f refactor(growth): remove useTelemetryCookie and sb-telemetry-data cookie (#43840)
The `sb-telemetry-data` cookie and `useTelemetryCookie` hook are fully
superseded by the `_sb_first_referrer` edge cookie (GROWTH-625) and the
in-memory first-touch store (GROWTH-656). GROWTH-656 already removed the
`useTelemetryCookie` call from `PageTelemetry` — this PR cleans up the
rest.

**Changes**
- Delete `useTelemetryCookie.tsx` hook
- Remove `clearTelemetryDataCookie` from `telemetry-utils.ts` (and its
`TELEMETRY_DATA` dep)
- Remove the `clearTelemetryDataCookie` call from `consent.tsx` (the
cookie is never written anymore, so clearing it on deny is a no-op)
- Remove `TELEMETRY_DATA` key from `LOCAL_STORAGE_KEYS`

**Testing**
Verified no remaining references to `useTelemetryCookie`,
`sb-telemetry-data`, `TELEMETRY_DATA`, or `clearTelemetryDataCookie` in
the codebase.

GROWTH-646

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Removed local telemetry data collection and cookie storage
functionality.
* Updated consent handling to remove associated telemetry cookie cleanup
operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-15 23:51:01 +01:00
Ivan Vasilov 1cd1ebfc7f chire: Sort imports in all packages, cms, design-system and ui-library apps (#41610)
Sorted all imports in all packages, `cms`, `design-system` and
`ui-library` apps by running `pnpm format` on them.

All changes in this PR are done by the script.
2026-02-05 13:54:10 +01:00
Sean Oliver de8e9f6b1b Fix first-touch referrer for initial $pageview (#41447) 2025-12-19 10:42:16 -08:00
Sean Oliver 97d746b665 fix: resolve 50% session tracking discrepancy on root route (#37853)
* fix: resolve 50% session tracking discrepancy on root route

- Fixes race condition causing ~50% discrepancy in session tracking between client and server on root route
- Implements event queuing to capture telemetry events before PostHog initializes
- Adds session ID correlation to enable unified tracking analysis between client and server events
- Uses sendBeacon API for both pageview and pageleave events to ensure reliable capture even during navigation
- Adds production safeguards with try/catch blocks and memory caps to prevent API errors from breaking tracking

* refactor(posthog-client): reduce max pending events and improve event handling

- Decreased the maximum number of queued events from 200 to 20
- Added the use of the sendBeacon API for pending events to survive page unload
- Added comments to clarify the handling of pending properties and events during posthog initialization
2025-08-13 12:54:52 -07:00
Jordi Enric 6f1cfef213 clean circular deps (#34262)
* clean circular deps in telemetry

* clean circular deps in command

* fix commandmenu circular deps

* rm deps.json

* fix consent circular dep

* fix TOC circular deps

* fix wrong import path

* fix test types

* fix missing fn

* undo let change

* fix consent component

* empty
2025-03-20 11:11:11 +01:00