Expand description
The optional first-party script ([traffic] script = true, 18.31.0):
rws serves /_rws/t.js itself, and the script reports to /_rws/t on
the same origin what the server can’t see — time on page, scroll depth,
screen size, single-page-app route changes and custom events
(rws.track("signup", {plan: "pro"})). Nothing is stored in the
browser; the visitor is the same daily hash as for every request.
TrafficScriptLayer answers only those two paths and passes every
other request straight through (Middleware::is_passthrough), so it
costs nothing elsewhere and doesn’t take proxy routes off the async
forwarder.
Structs§
- Traffic
Script Layer - Answers
/_rws/t.jsand/_rws/twhen[traffic] scriptis on (it reads the setting when built); otherwise, and for every other path, passes the request on.
Constants§
- BEACON_
PATH - Where the script reports.
- MAX_
BEACON - The largest report accepted.
- SCRIPT
- The script. No dependencies, no storage, ~1.6 KB (0.8 KB compressed). The first page view is already counted by the server, so it reports only what happens after: leaving a page (time, scroll, width), route changes, events.
- SCRIPT_
PATH - The script’s URL path.