URL Parser

Every component of a URL, with query parameters decoded and tracking parameters flagged.

Components
—
Query parameters
—
URL without tracking parameters
—

Worked example

The scheme is everything before the colon, the fragment is everything after the hash and is never sent to the server. Query parameters are sent, which is why tracking parameters work and why stripping them changes the request the server sees.

URLs have more structure than they appear to. The fragment never reaches the server, the port may be implied by the scheme, and the query string is a sequence of pairs with no ordering guarantee.

Why decode parameters

A parameter value arrives percent-encoded. Comparing the raw string against an expected value fails whenever the value contains a space, an ampersand or a non-ASCII character — which is most of the time.