webserver_base/analytics/mod.rs
1//! First-party proxies for Plausible and the Sentry browser SDK.
2//!
3//! Both vendors' own origins are on blocklists, and a blocked request is a
4//! visitor you never counted or an error you never saw. Serving their scripts
5//! and receiving their payloads from this origin makes the traffic
6//! same-origin, which is what Plausible themselves recommend.
7//!
8//! Nothing here interprets a payload — see [`proxy`] for why that matters.
9
10mod config;
11mod ip;
12mod proxy;
13
14pub use config::{
15 AnalyticsConfig, ENV_ANALYTICS_ID, ENV_SENTRY_BROWSER_DSN, PLAUSIBLE_HOST, SENTRY_CDN_HOST,
16 SentryDsn, SentryDsnParseError,
17};
18pub use ip::{CLIENT_IP_HEADERS, resolve_true_client_ip_address};
19pub use proxy::{relay_envelope, relay_event, relay_script};