feat: add setting to disable PID URL tracking parameters#1196
Merged
Conversation
Add "Disable URL tracking parameters?" checkbox under Settings > Privacy. When enabled, internal links inside popups no longer get ?pid= appended. Instead, link clicks are tracked via browser beacons (sendBeacon/image pixel), the same method already used for external links. When analytics are fully disabled via the existing "Disables popup open tracking?" setting, no tracking of any kind is applied — no pid params, no beacons, no click handlers.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds a privacy setting to disable adding popup ID URL parameters to links. When enabled, internal popup links use beacon-based click tracking instead of appended PID query params. The setting is exposed in admin, localized into site JS, and honored by the popup link processing script. Changes
Sequence Diagram(s)sequenceDiagram
participant Admin as rgba(40, 116, 166, 0.5) Admin UI
participant PHP as rgba(34, 139, 34, 0.5) Backend (Settings & Localization)
participant Browser as rgba(178, 34, 34, 0.5) Client (Site JS)
Admin->>PHP: Toggle disable_pid_url_params
PHP->>PHP: Save option
PHP->>Browser: Localize pum_vars { disable_url_params }
Browser->>Browser: processPopupLinks(href)
alt disable_url_params == false
Browser->>Browser: Append popup ID query param (pid) to internal links
else disable_url_params == true
Browser->>Browser: Attach beacon/click-tracking handler to internal links
end
Browser->>Server: Click beacon or navigation with pid param
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
`(array) file_exists($file) ? require $file : []` parses as `((array) file_exists($file)) ? require $file : []` — since `(array) false` yields `[false]` (truthy), the file_exists guard never actually prevented the require. Move the cast after the ternary so the guard works correctly.
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
?pid=appended to their URLssendBeacon/ image pixel) — the same method already used for external, mailto, and tel linksChanges
classes/Admin/Settings.phpdisable_pid_url_paramscheckbox in Privacy tabclasses/Site/Assets.phpdisable_url_paramsto frontendpum_varsassets/js/src/site/plugins/pum.jsdisable_url_params: falseassets/js/src/site/plugins/pum-url-tracking.jsdisable_trackinganddisable_url_paramsflagsTest plan
?pid=XappendedSummary by CodeRabbit