Website event tracking for product and engineering teams: taxonomy, RUM sessions, traces and alerts
How to design website events that product and engineering both trust: a naming convention, a property schema, the link to RUM sessions and backend traces, consent, data quality checks and alerts when a funnel suddenly breaks.
Summary
- Website event tracking works when every event follows one naming convention, carries a defined property schema and is documented in a tracking plan that product and engineering maintain together.
- Attaching a session ID to every event and propagating trace context from the browser to the backend turns a funnel drop-off from a mystery into a concrete JavaScript error, slow API call or failing payment request.
- Consent under the GDPR and, in Germany, Section 25 TDDDG, automated data quality checks and alerts on event anomalies such as a sudden drop in checkout events keep the data lawful, reliable and actionable.
Website event tracking records what people actually do on your site: which pages they open, which buttons they click, which forms they submit and where they give up.
This guide is written for product and engineering teams who want events that serve both sides. It covers the kinds of website events worth tracking, how to design an event taxonomy and naming convention, a property schema, how to connect events to real user monitoring sessions and backend traces, what consent rules mean in practice, how to check data quality, and how to alert when key events suddenly drop. It ends with a tracking plan template you can copy.
What website events are and which ones matter
An event is a timestamped record that something happened, plus a set of properties that describe the context. On a website, events fall into a few groups:
- Page views and route changes. In a single-page application, a "page view" is a client-side route change, not a full document load. Track both explicitly, or your funnel steps will be counted differently depending on how the user navigated.
- Form events. Form started, field validation failed, form submitted, form submission failed. The difference between "submitted" and "submission failed" is where many conversion problems hide.
- Custom business events.
product_added_to_cart,checkout_started,payment_submitted,order_completed,account_signed_up,trial_started. These are the events your funnels and revenue reports are built on. - Technical events. JavaScript errors (the
errorevent onwindow), unhandled promise rejections (unhandledrejection), failed fetch requests and slow resources. - Frustration signals. Rage clicks (several rapid clicks on the same element or area) and dead clicks (a click that produces no visible reaction, no navigation and no network request). There is no formal standard for either; each tool defines its own thresholds, so document the definition you use.
The point of combining these groups is correlation. A drop in checkout_started to order_completed is a business number. The same drop, shown next to a spike in JavaScript errors on the payment step and rage clicks on the "Pay now" button, is a bug report.
Designing an event taxonomy and naming convention
A taxonomy is the agreed structure of your events: which events exist, what they are called and which properties they carry. The naming convention is the part that breaks first, so decide it early and write it down.
- Use object_action in the past tense.
form_submitted,product_added_to_cart,checkout_started. The object comes first, so related events sort together; the past tense makes clear that the event records something that already happened. - One casing style everywhere. snake_case is common and readable. Mixing
SignUp,sign-upandsignup_completedcreates three events for one action. - Put variation into properties, not names.
cta_clickedwithcta_id: "hero_trial"is better thanhero_trial_button_clicked. Event names stay few and stable, and you can still filter by every button. - Version the schema, not the name. When properties change, increment a
schema_versionproperty instead of creatingcheckout_started_v2.
An event properties schema both teams can rely on
Every event should carry two kinds of properties: a common context block that is identical for all events, and event-specific properties defined in the tracking plan.
{
"event": "checkout_started",
"schema_version": 3,
"timestamp": "2026-10-28T09:14:03.512Z",
"context": {
"session_id": "6f1c2a7e-0b9d-4c55-9a51-2d0e7c3f8b11",
"page_path": "/checkout",
"page_template": "checkout",
"app_version": "2026.10.4",
"locale": "de-DE",
"device_type": "mobile",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
},
"properties": {
"cart_value": 129.90,
"currency": "EUR",
"item_count": 3,
"checkout_type": "guest"
}
}
A few rules keep the schema healthy:
- Typed and constrained. Define the type, allowed values and whether a property is required.
currencyis an ISO 4217 code, not "Euro" in one place and "EUR" in another. - Templates instead of raw values. Use
page_templateor a route pattern instead of full URLs with query strings. That protects against high cardinality and keeps tokens or email addresses in URLs out of your data. - No personal data in properties. No names, email addresses, free-text form contents or full IP addresses. If you need a user reference, use a pseudonymous ID and treat it as personal data anyway.
- The release version on every event.
app_versionlets you compare conversion before and after a deploy, which is often the fastest way to find a regression.
Connecting events to RUM sessions and backend traces
Product analytics tells you that users drop off between two steps. Real user monitoring tells you what the page did for those users at the same moment: load time, Core Web Vitals, JavaScript errors and network requests. Backend traces tell you what happened on the server. Joining the three is what turns event tracking into a diagnostic tool.
Step 1: one session ID for everything
Generate a session identifier in the browser and attach it to every business event, every RUM measurement and every error. OpenTelemetry has semantic conventions for sessions with the attribute session.id (and session.previous_id); they are still marked as in development, so check the current status before relying on them. With a shared ID, you can open a single failed checkout and see the full sequence of clicks, errors and requests, or replay it with session replay where that is permitted.
Step 2: propagate trace context from the browser
The OpenTelemetry JavaScript instrumentations for fetch and XMLHttpRequest create a span for each request and can inject the W3C traceparent header. For requests to a different origin, such as api.example.com, you must allow it explicitly with propagateTraceHeaderCorsUrls:
import { FetchInstrumentation } from '@opentelemetry/instrumentation-fetch';
new FetchInstrumentation({
// only your own APIs, never third-party domains
propagateTraceHeaderCorsUrls: [/^https:\/\/api\.example\.com\//],
ignoreUrls: [/\/collect$/],
});
The API must also accept the header: because traceparent is not a CORS-safelisted header, the server has to list it in Access-Control-Allow-Headers for the preflight request. Once that works, a payment_submitted event and the backend trace of the payment call share a trace ID, and distributed tracing shows whether the time went into your API, the database or the payment provider. The OpenTelemetry project still describes browser instrumentation as experimental.
Step 3: read the funnel with technical context
For every funnel step, put three questions side by side: how many sessions reached the step, how many of them had an error or a slow request on this step, and how the conversion of sessions with and without such problems compares. If sessions with a failed POST /api/checkout almost never reach order_completed, you have a prioritized bug, not a UX hypothesis. Error tracking then groups the underlying exceptions so the team can fix the cause instead of the symptom.
Consent, GDPR and TDDDG: what applies to event tracking
This section is an overview, not legal advice. Clarify your setup with your data protection officer or legal counsel.
- Two layers of rules. In the EU, storing or reading information on a user's device (cookies, localStorage, device identifiers) is governed by Article 5(3) of the ePrivacy Directive. In Germany it is implemented in Section 25 TDDDG, the Telecommunications Digital Services Data Protection Act, which replaced the name TTDSG on 14 May 2024 with largely unchanged content. Any processing of personal data afterwards also needs a legal basis under the GDPR.
- Consent unless strictly necessary. Access to the device without consent is only allowed where it is strictly necessary for a service the user explicitly requested. Analytics and product tracking generally do not fall under that exception. Whether specific technical monitoring does is a case-by-case assessment.
- Respect the decision technically. Do not load tracking code or set identifiers before consent, honour withdrawal immediately, and make sure your event layer checks the consent state rather than relying on each script to do it.
- Minimize and mask. Collect only the properties in your tracking plan, truncate or drop IP addresses, mask form inputs in session replay and strip query parameters. PII masking in the telemetry pipeline adds a second line of defence before storage.
Consent also affects data quality: event counts reflect only consenting users. Compare trends and ratios, and do not treat absolute numbers as complete traffic.
Data quality checks that catch broken tracking early
Tracking breaks silently. A renamed CSS class, a refactored form component or a new consent banner can stop an event without any error. Build checks into the delivery process and into production monitoring:
- Schema validation at ingestion. Reject or quarantine events with unknown names, missing required properties or wrong types, and count the rejections per event and release.
- Automated tests for critical events. End-to-end tests for the main journeys should assert that
checkout_startedandorder_completedfire exactly once with the expected properties. - Volume and ratio monitors. Track events per hour against a baseline and the ratio between adjacent funnel steps. A ratio is more robust than absolute volume because it is less affected by traffic swings and consent rates.
- Reliable delivery. Queue events in memory and flush them when the page becomes hidden via the
visibilitychangeevent withnavigator.sendBeacon(); theunloadevent is unreliable, particularly on mobile. - Server-side truth for money events. Record
order_completedon the server when the order is actually created, and use the client event only for context. Compare both counts daily.
Event tracking plan template
A tracking plan is the single source of truth for your events. Keep it in the repository next to the code, review changes like code and give every event an owner. The rows below are examples; adapt them to your own journeys.
| Event name | Trigger | Required properties | Owner | Alert (example) |
|---|---|---|---|---|
page_viewed | Document load or SPA route change | page_template, app_version | Frontend | Volume below 50 % of same hour last week |
cta_clicked | Click on a tracked call to action | cta_id, page_template | Product | None, reporting only |
form_submitted | Successful client-side validation and send | form_id, schema_version | Product | Submit-to-success ratio drops by 30 % |
form_submission_failed | Request fails or server returns an error | form_id, error_type, http_status | Backend | Rate above 5 % for 15 min |
product_added_to_cart | Cart API confirms the item | product_category, quantity, currency | Shop team | Volume anomaly against baseline |
checkout_started | First checkout step rendered | cart_value, currency, item_count | Shop team | Cart-to-checkout ratio anomaly |
order_completed | Server confirms the order (server-side) | order_value, currency, payment_method | Shop team | No orders for 30 min in business hours |
js_error_occurred | error or unhandledrejection on window | error_fingerprint, page_template, app_version | Frontend | New fingerprint after a deploy |
rage_click_detected | Example: 3+ clicks on one element within 1 s | element_id, page_template | Frontend | Spike on checkout or sign-up pages |
Checklist for website event tracking
- Naming convention (object_action, past tense, snake_case) documented and enforced in review
- Tracking plan in the repository with trigger, properties, types, owner and alert per event
- Common context block on every event: session ID, page template, app version, locale
- No personal data, full URLs or free text in properties; IPs truncated or dropped
- Tracking loaded only after consent; withdrawal handled immediately
- Session ID shared by business events, RUM data and JavaScript errors
traceparentpropagated to your own APIs only and allowed in CORS- Schema validation at ingestion with a counter for rejected events
- End-to-end tests assert critical events fire exactly once
- Money events recorded server-side and reconciled with client events
- Flush on
visibilitychangewithsendBeacon() - Volume and funnel ratio alerts with deploy markers
Alerting on event anomalies
Uptime checks tell you whether the site responds; our website uptime monitoring guide covers that layer. They do not tell you that the checkout button has stopped working for Safari users since this morning's release. Business event alerts close that gap.
- Alert on ratios and seasonality, not fixed numbers. Traffic differs between Monday morning and Saturday night. Compare with the same hour last week, or use anomaly detection that learns daily and weekly patterns.
- Use absence alerts for critical events. "No
order_completedfor 30 minutes during business hours" is simple and catches total failures that anomaly models may take longer to flag. - Segment the alert. A drop on one browser, one locale or one payment method is invisible in the total. Group alerts by a small number of meaningful dimensions.
- Attach technical context. An alert on falling checkout conversion should link to the error rate, slowest requests and latest deploy for the same pages, so whoever picks it up starts with evidence.
- Connect to SLOs. For a journey like checkout, define a success-rate objective and alert on burn rate; our article on SLOs and error budgets in practice describes how.
Send JavaScript errors and failed event deliveries as structured logs with session and trace IDs as well, so frontend and backend investigations use the same identifiers.
How Obseria helps with website event tracking
Obseria is an OpenTelemetry-native observability platform. Its real user monitoring collects page loads, Core Web Vitals, JavaScript errors and network requests in the same place as backend traces and logs, so a drop-off in a funnel can be traced to the request, error or deploy behind it, with data stored in the EU.
- The Obseria Pipeline filters events, masks personal data and samples high-volume signals before storage.
- Browser spans and backend traces are joined via W3C trace context, from the click to the database query.
- Obseria Intelligence correlates a drop in business events with errors, latency and recent changes and shows the evidence.
- SLOs with burn-rate alerts and anomaly detection cover critical journeys such as sign-up and checkout.
You can connect your website and see your first sessions with a free Obseria trial.