feat(autocapture): attach selector algo config hash on zoning events - #1861
Draft
jxiwang wants to merge 1 commit into
Draft
feat(autocapture): attach selector algo config hash on zoning events#1861jxiwang wants to merge 1 commit into
jxiwang wants to merge 1 commit into
Conversation
Add stable selector-config hashing primitives to @amplitude/element-selector (from #1841) and wire the hash onto autocapture events that already flow through the element-selector engine. The hash is attached only where @amplitude/element-selector is already used: - DataExtractor.getEventProperties (Element Clicked, Element Changed, Rage Click, Dead Click, Error Click, and other selector-bearing element events) - Viewport Content Updated (element paths come from DataExtractor.getElementPath) Page Viewed is intentionally excluded because page-view-tracking does not consume the element-selector package.
size-limit report 📦
|
jxiwang
changed the base branch from
main
to
cursor/element-selector-config-hash-7d25
June 26, 2026 22:47
jxiwang
changed the base branch from
cursor/element-selector-config-hash-7d25
to
main
June 26, 2026 22:47
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.
Summary
Wires
[Amplitude] Selector Algo Config Hashonto autocapture events that already flow through@amplitude/element-selector. This builds on the hashing primitives from #1841 and limits attachment to existing element-selector integration points only.Where the hash is attached
@amplitude/element-selectoris only consumed byplugin-autocapture-browsertoday, so the hash is attached there:[Amplitude] Element ClickedDataExtractor.getEventProperties()[Amplitude] Element ChangedDataExtractor.getEventProperties()[Amplitude] Rage ClicktargetElementPropertiesspread fromgetEventProperties()[Amplitude] Dead Click/[Amplitude] Error ClickgetEventProperties()[Amplitude] Viewport Content UpdatedfireViewportContentUpdated()(element paths already come fromDataExtractor.getElementPath())Not included:
[Amplitude] Page Viewed—plugin-page-view-tracking-browserdoes not use@amplitude/element-selector, so no new dependency or subscription was added there.What's added in
@amplitude/element-selectorhashSelectorConfig()/canonicalizeSelectorConfig()— stable SHA-256 fingerprint of resolved configAMPLITUDE_EVENT_PROP_SELECTOR_ALGO_CONFIG_HASH— shared event property keyELEMENT_SELECTOR_REMOTE_CONFIG_KEY— re-exported from element-selector; autocapture'selement-selector-config.tsnow imports it from thereVerification
pnpm --filter @amplitude/element-selector test— 284 passedpnpm --filter @amplitude/plugin-autocapture-browser test— 413 passed (100% coverage)pnpm build— all 27 packages built successfullypnpm lint— clean for changed packages