discourse/app
Osama Sayegh 27a843fa0f
FEATURE: beacon-based implementation for BPV (#38897)
This commit adds a new parallel page view counting system that uses `fetch` with `keepalive: true` to POST to a dedicated `/srv/pv` endpoint, gated behind the `use_beacon_for_browser_page_views` site setting.                                                                                                                                                                        

Unlike the existing deferred tracking (which piggybacks on AJAX headers), the beacon approach sends page view data directly as a JSON body. Both systems run simultaneously when the setting is enabled to allow comparing counts before fully migrating.

Key details:
                                                                                                                                                                                                                                      
* New middleware endpoint `POST /srv/pv` short-circuits with 204
* Dedicated `ApplicationRequest` counters (`*_beacon`) track beacon page views separately from the existing browser page view counters
* A separate `:beacon_browser_pageview` DiscourseEvent avoids double-firing with the existing `:browser_pageview` event
* On Ember route transitions, `routeDidChange` sends the beacon. For non-Ember pages (e.g. `/pub/*`), `pageview.js` handles it

Internal topic: t/179398.
2026-04-15 16:32:05 +03:00
..
assets FEATURE: Translate theme component translatable fields (#39282) 2026-04-15 21:12:14 +08:00
controllers UX: Show disabled tags with explanations in composer tag search (#39072) 2026-04-14 10:37:27 +02:00
helpers FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00
jobs DEV: Centralize push notification delivery into a single job (#39207) 2026-04-14 11:55:45 -03:00
mailers DEV: Strip unsubscribe links when sending digest previews to arbitrary addresses (#38298) 2026-03-05 13:58:51 -06:00
models FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00
queries/reports FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00
serializers FEATURE: A dedicated 'show original' user preferences saved to user options (#39128) 2026-04-07 21:37:20 +08:00
services FEATURE: Add opt-in IAM role assumption for S3 operations (#39174) 2026-04-15 04:29:50 +08:00
views FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00