GLOSSARY

Query Strings

A query string is the part of a URL after ? that carries parameters. Stores use it to keep filter state, sorting, pagination, and tracking.

What is a Query String?

A query string is a key=value parameter list appended to a URL (e.g., ?size=45&color=black&sort=price_asc&page=2). It encodes filters, facets, sorts, pagination, tracking, and sometimes search terms (when not using path-based routes).

How It Works (quick)

  • Encoding: Keys/values are URL-encoded; arrays or repeated keys represent multi-select facets.
  • Parsing: Server or client reads params and applies filters/sorts; updates URL on changes.
  • State & sharing: The URL becomes a shareable bookmark of the current view.
  • SEO controls: Canonicals, parameter handling rules, and noindex for infinite combos.

Why It Matters in E-commerce

  • UX: Persistent state enables sharable filtered collections and back/forward navigation.
  • Analytics: Parameters clarify user intent and campaign attribution.
  • Performance: Parameterized APIs enable caching for popular combos.

Best Practices

  • Human-safe keys: size, brand, price_min/price_max, in_stock=true.
  • Canonicalization: One canonical per collection; whitelist a small set of SEO-worthy params; add noindex to the rest.
  • Sorting & paging: Include sort and page parameters; keep page size bounded.
  • Security: Sanitize inputs; ignore unknown params; don’t expose secrets in URLs.
  • Privacy: Avoid PII in query strings; use short-lived tokens for sessions.
  • UTM hygiene: Strip or consolidate tracking params when generating internal links.

Challenges

  • Crawl bloat from facet permutations; duplicate content; long URLs; locale/unit differences.

Examples

  • /men/trail-running?size=45&waterproof=true&price_min=80&price_max=150&sort=rating_desc
  • /search?q=air+max+270&in_stock=true&page=1

Summary

Query strings carry the state of your collections and search. Keep keys clean, sanitize inputs, and control crawl space with canonicals and parameter rules.

FAQ

Path or query string for search terms?

Either works; path looks cleaner (/search/air-max-270) but query params are simpler and flexible.

How to handle multi-select facets?

Repeat keys (brand=Nike&brand=Adidas) or use arrays (brand=Nike,Adidas) consistently.

Will parameters hurt SEO?

Not if you canonicalize and limit indexable combinations.