A course named C++ or a partnership label A+B can be corrupted when a campaign URL is assembled by string concatenation. A plus sign in form-style query encoding can mean a space. Commission a round-trip test of the actual parameter values before using the link.
Primary evidence and claim boundaries
URLSearchParams uses application/x-www-form-urlencoded conventions: spaces serialize as plus, and literal plus characters must be encoded when constructing values. Passing a full URL as a query string is not URL parsing. Primary reference · Read 18 October 2026.
Filled acceptance example
Original synthetic teaching scenario, not a client case, provider integration test or business result. The example policy needs the actual owner’s approval; scroll the table on narrow screens.
| Input and state | Declared check | Expected output and decision |
|---|---|---|
| course=C++ as a value passed with set | Serialize then parse | course returns C++, not C plus two spaces |
| Query text course=C++ constructed manually | Parse as form-style query | Decodes plus signs as spaces; fails intended identity |
| partner=A+B and label=Spring sale | Serialize two separate values | A%2BB and Spring+sale; both decode correctly |
| destination=https://example.test/?a=1&b=2 | Store destination as one query value | Nested ampersand must not become a second outer parameter |
Practical handover procedure
- Write the intended values separately from the final URL. Use opaque non-personal campaign labels and an allowlisted destination; do not place customer emails or secrets in a query.
- Construct parameters through the URL APIs, then parse the complete URL and compare every recovered value and parameter count with the original.
- Have the receiving website or authorised test endpoint display the decoded test values. Distinguish link integrity from analytics attribution and actual enquiries.
Interpret the outcome
A%2BB and A+B carry different raw query meanings under this convention. Visual inspection of the address bar may miss the distinction. The nested destination row also catches a common splitter defect without sending a request to any third party.
Acceptance decision
Every decoded value and the outer parameter count must match the intended record. A correctly encoded link is not evidence that its campaign produced a sale.
Limits and unverified work
Synthetic labels and example.test URLs. No campaign submission, external message, analytics change or tracking-code installation is performed.
Download the filled bilingual acceptance record — Contains the inputs, steps, expectations and limits. This is a teaching record, not an executable production integration.