discourse/spec
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
..
db DEV: Silence expected error/debug output in core specs (#39247) 2026-04-14 11:04:10 +02:00
fabricators FIX: Correct visit counter calculations for stacked report data (#38362) 2026-03-10 14:30:49 +08:00
fixtures FIX: Better handling of github_folder onebox w/o opengraph tags (#39142) 2026-04-08 11:49:57 +02:00
generator DEV: Remove deprecated trust level access settings (#36414) 2025-12-11 11:09:29 +10:00
helpers FIX: Make twitter card meta data translatable (#39150) 2026-04-08 18:40:21 +02:00
import_export DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
initializers FEATURE: Notify admins of upcoming changes and log events (#37003) 2026-01-21 12:45:54 +10:00
integration FEATURE: add modifier to restrict theme color schemes (#38796) 2026-03-26 09:03:11 -04:00
integrity FEATURE: Allow upcoming changes to control site setting defaults (#38815) 2026-04-08 13:05:44 +10:00
jobs FIX: Limit what's new to the last 4 months (#39216) 2026-04-15 11:43:12 +10:00
lib FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00
mailers FEATURE: Add recipient_username interpolation key for email templates (#38096) 2026-02-27 17:18:02 +01:00
models DEV: Don't use fab! for non-ActiveRecord model objects (#39272) 2026-04-15 00:52:34 +02:00
multisite DEV: Fix spec cleanup issues for upcoming changes (#39024) 2026-04-01 14:15:02 +10:00
queries/reports UX: Add more reports to legacy, removing them from the reports page (#38688) 2026-03-18 22:18:47 +08:00
requests DEV: Silence expected error/debug output in core specs (#39247) 2026-04-14 11:04:10 +02:00
script/import_scripts
serializers FEATURE: Support group based category posting review modes (#38707) 2026-04-07 10:41:16 +08:00
services DEV: Don't use fab! for non-ActiveRecord model objects (#39272) 2026-04-15 00:52:34 +02:00
support DEV: Fix deprecations in plugins specs and silence output (#39257) 2026-04-15 00:00:46 +02:00
system FEATURE: beacon-based implementation for BPV (#38897) 2026-04-15 16:32:05 +03:00
tasks DEV: Silence expected error/debug output in core specs (#39247) 2026-04-14 11:04:10 +02:00
views FIX: remove ItemList schema from linkbacks in crawler view (#36608) 2025-12-11 10:41:47 +01:00
rails_helper.rb DEV: Silence expected error/debug output in core specs (#39247) 2026-04-14 11:04:10 +02:00
regenerate_swagger_docs
swagger_helper.rb DEV: add api docs for discourse-calendar events index endpoint (#35400) 2025-10-16 07:39:08 +08:00