🔥 feat(tracking): Adding hover tracking; making other tracking adjustments#162
Merged
Charles Hudson (phobetron) merged 1 commit intomainfrom Mar 3, 2026
Merged
Conversation
…ments - Added first-class **automatic hover tracking** for entries (`hovers`) alongside existing `views` and `clicks`, including runtime wiring in `EntryInteractionRuntime` and tracking API support (`tracking-enable/disable/enableElement/---` for hovers)- - Introduced a new **`component_hover` event model** end-to-end: schema (`ComponentHoverEvent`), event union inclusion, event builder support (`buildComponentHover`), and analytics dispatch paths in both stateful and stateless cores- - Refactored web entry-tracking internals into a new **`entry-tracking/events/*` structure**, including shared observer lifecycle utilities and a reusable `createTimedEntryDetector` abstraction used by view/hover detectors- - Expanded view/hover observer behavior to support **dwell + periodic duration updates + final event on exit**, with stable per-session IDs (`componentViewId` / `componentHoverId`) and visibility/in-flight callback handling- - Added per-element dataset support for hover behavior, including **`data-ctfl-track-hovers`** and **`data-ctfl-hover-duration-update-interval-ms`**, plus override resolution updates- - Updated public configuration/docs so `autoTrackEntryInteraction` now includes **`hovers`** (default false), and updated tests to validate the new option- - Added substantial automated coverage: new unit tests for hover detector/observer, expanded view-runtime tests, and new cross-implementation Playwright E2E suites for hover/click behavior and consent gating- - Updated demo/reference implementations (React, vanilla, SSR, preview panel) to enable hover auto-tracking and improve event stream rendering by **coalescing heartbeat-style hover/view updates** by session ID- - Increased web bundle size thresholds in `check-bundle-size-ts` to account for the added tracking/runtime surface- - Included a separate ancillary change in core personalization: replaced `es-toolkit/compat/get` usage with an internal `getAtPath` resolver in `MergeTagValueResolver`- [[NT-2595](https://contentful-atlassian-net/browse/NT-2595)]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hovers) alongside existingviewsandclicks, including runtime wiring inEntryInteractionRuntimeand tracking API support (tracking-enable/disable/enableElement/---for hovers)-component_hoverevent model end-to-end: schema (ComponentHoverEvent), event union inclusion, event builder support (buildComponentHover), and analytics dispatch paths in both stateful and stateless cores-entry-tracking/events/*structure, including shared observer lifecycle utilities and a reusablecreateTimedEntryDetectorabstraction used by view/hover detectors-componentViewId/componentHoverId) and visibility/in-flight callback handling-data-ctfl-track-hoversanddata-ctfl-hover-duration-update-interval-ms, plus override resolution updates-autoTrackEntryInteractionnow includeshovers(default false), and updated tests to validate the new option-check-bundle-size-tsto account for the added tracking/runtime surface-es-toolkit/compat/getusage with an internalgetAtPathresolver inMergeTagValueResolver-[NT-2595]