Repository navigation
Preserve distinct manual pageviews in v12 - #108
Conversation
Requested in the compatibility review: fix query-only manual pageview loss and preserve full path-overwriter input. Keep the filtered outgoing path and review campaign attribution separately. Refs #107
Documentation update
|
Claude review checkpointReviewed commit |
|
SDLC label: |
Address automated review of item 1: normalize the manual query after the path-overwriter callback and before ignore-pages/hash handling, while keeping its query in the duplicate key. Refs #107
Address review of item 1: only split string path values, preserving numeric manual paths and numeric path-overwriter results without introducing an exception into the customer page. Refs #107
|
In response to #108 (comment), superseding #108 (comment): Confirmed in 15e99ef: The separate query-attribution clarification requested in #109 is tracked there and remains unpublished pending the existing request for approval of a supporting docs PR. |
Requested during review: keep the existing path-overwriter behavior without query strings, while retaining distinct manual-query pageviews. Restore query splitting before getPath and update the callback and duplicate checks.
Carry the requested callback compatibility correction from PR #108 into its dependent attribution PR. Remove queries before getPath, preserve distinct-query duplicate detection, and regenerate the bundles. All 21 unit tests and both builds pass.
|
The earlier documentation update comment and the docs patch prepared from it are now incorrect: |
Requested: merge the current v12 branch into PR #108 and defer dist compilation until the end. Preserve pathname-only path-overwriter input and query-aware duplicate detection alongside v12 inline events. The combined source passes all 38 unit tests and formatting checks in a temporary build; repository dist files are unchanged.
Requested: rebuild the distributions after PR #108 and verify that manual queries override browser parameters, absent manual queries fall back to location.search, and existing filtering remains effective. Include the newly merged phone-click fix from #111 and preserve current inline events. Regenerate only the 29 affected bundles and source maps. All 39 unit tests and 24 additional payload checks pass on the pinned toolchain. Refs #107
Summary
Closes #107
Manual page views such as
/product?product-id=1and/product?product-id=2were deduplicated as the same path, so only the first one was counted.src/default.jsnow builds the duplicate key from the cleaned path plus the manual query (lastSendPath = path + querySearch) instead of the cleaned path alone, so both are counted while an identical consecutive call stays suppressed.The existing
myPathOverwriterbehavior is preserved: the query is removed beforegetPath()runs, so the callback still receives{ path: "/product" }. Ignore-pages matching, hash routes, numeric manual paths and numeric callback return values are unchanged. The reportedpathnever contains the query; the manual query is only used internally as part of the duplicate key, and is still filtered throughgetQueryParams()before anything is sent.An earlier proposal to pass queries into the callback is superseded and needs no documentation change. Browser-query attribution is handled separately in #109.
v12at38248a0was merged into this branch. The committeddist/has not been regenerated since that merge, so it is currently older than the base branch and drops the inline-events feature from #106; it needs apnpm run buildbefore merge.Changes:
Security implications
Has security impact - described as: manual page views that differ only in their query string are no longer collapsed into one, so more page view records are collected for the same path. No additional personal data is sent, because the query string is still stripped from the reported
pathand query parameters remain filtered by the existing allow-params and UTM rules.Testing
npx mocha "test/unit/*.test.js" --exitagainst the committeddist/at1787a45: 15 failing, 23 passing — every test intest/unit/inline-events.test.jsfails because the committed bundles predate the Support inline events in the main v12 script #106 merge.node compile.jsthennpx mocha "test/unit/*.test.js" --exit: 38 passing, covering inline events, distinct-query manual page views, identical repeated calls, ignore-pages, hash routes, numeric paths/results, and pathname-only callback input. The working tree was restored afterwards, sodist/on this branch is still stale.npm install(the declared Node 24 / pnpm 11 toolchain was not available in the review environment).Checklist