Development Note: What M3U8Online Removes from Analytics Page Fields

A streaming tool needs to distinguish the page someone visits from the stream they enter. Copying a complete page URL into an analytics event can preserve information that was intended only for the player. Our page-field helper therefore constructs a smaller set of values before the application sends its manual page-view event.

This note follows the actual implementation in lib/analytics.ts, rather than presenting a generic promise that every URL is anonymous. The helper removes query strings and fragments from its path input, reduces an HTTP or HTTPS referrer to its origin, and retains the remaining page path. That last point is a deliberate boundary of this test: a sensitive value in a pathname would survive.

Verification method โ€” November 2, 2026: A Node.js test transpiled the current TypeScript module and invoked its actual exported safePageFields function. Four assertions compared all three returned fields for controlled query/fragment, referrer-credential, unsupported-protocol and malformed-referrer cases. A fifth assertion confirmed that a synthetic secret in a pathname is retained. Inputs used reserved example hosts and synthetic markers. No real stream, analytics upload, Google account setting, consent interaction or production request capture was tested. Source inspection of the calling component is described separately from these function assertions.

What the controlled inputs returned

The marker in these inputs is test data, not a credential. The complete field comparisons also checked that page_title used the stripped path rather than the page's arbitrary document title.

Controlled inputReturned page locationReturned referrer
/en?video_url=SYNTHETIC_SECRET#SYNTHETIC_SECRET, HTTPS referrer with a private path and queryhttps://m3u8online.com/enhttps://source.example
Public article path, referrer containing synthetic user informationSame public article path under the site originhttps://source.example
/en, referrer using javascript:https://m3u8online.com/enEmpty string
/en, malformed referrer texthttps://m3u8online.com/enEmpty string

The helper does not forward the original referrer string after extracting its origin. Its page title is constructed as M3U8Online followed by the selected path. In the retained-path control, /private/SYNTHETIC_SECRET remained in the page location; the function is not a general detector for sensitive content.

The reproducible check is node scripts/test-analytics-page-fields.cjs. It requires the installed project dependencies and runs locally without network access. A passing result establishes the output for these five controlled cases, not the behavior of every analytics tag or browser extension.

How the calling component uses the helper

Source inspection of components/AnalyticsConsent.tsx shows that the component passes Next.js's pathname and document.referrer to the helper. It sets the resulting fields before initialization and includes them in its explicit page_view event. The initialization helper sets send_page_view: false, while the component makes a separate decision about when to emit its manual event.

Those code observations do not prove that a production Google Analytics property has the intended Enhanced Measurement configuration. Google's current documentation distinguishes the initial config-triggered page view from history-based enhanced measurement: disabling the former does not alone disable the latter. Account configuration and actual outgoing requests need separate verification. We did not inspect or change the account in this test.

The component's source also gates initialization on an accepted analytics choice and excludes embed routes. That describes the implementation we read; it is not a fresh browser acceptance test of consent withdrawal, storage restrictions or every navigation sequence. This note does not turn a helper-function check into a compliance assessment.

What this helper does not remove

BoundaryConsequenceReview needed
Remaining pathname is preservedA private identifier placed in a route can remain in location and titleKeep analytics routes public or map them to approved route categories
Referrer origin is preservedThe referring host can still reveal contextDecide whether origin-level attribution is appropriate
Other events are outside this functionA custom payload could independently contain stream dataInspect each event producer and actual request payload
Account-side measurement is separateHistory events may have their own behaviorCheck property settings and capture a controlled navigation

Removing one URL component is a data-minimization step, not a guarantee that the remaining data cannot identify someone. If the product later introduces account-specific route segments, the route policy and its tests need to change before those routes enter analytics. This helper's current public-page assumption should not silently become an assumption about every future URL.

A practical review sequence for a streaming tool

  1. List the fields that an event actually needs. For page navigation, distinguish the website route from the media URL entered into a form.
  2. Test the transformation with synthetic query, fragment, referrer and path markers. Include at least one case that documents a limitation rather than only positive examples.
  3. Inspect the call sites. A correct helper is ineffective if another component sends the raw address independently.
  4. Verify initial load and client-side navigation in an isolated browser session, including applicable account-side measurement settings. Keep any request capture private until reviewed.
  5. Review consent and withdrawal separately. Passing a field-formatting test is not evidence that the tag remained unloaded before consent or stopped after withdrawal.

For public bug reports, our safe incident guide explains why a limited summary is preferable to an unreviewed request export. If you are diagnosing media delivery rather than page analytics, start with the developer-tools request checklist. The website's privacy policy describes its user-facing practices; this development note documents a narrower implementation check.

Primary reference