Next Commerce
Data AttributesURL Parameters

URL Parameters

URL parameters control element visibility and behavior based on the page's query string. Use them for feature flags, A/B test variants, marketing campaign tracking, and development overrides.

How It Works

  1. The SDK captures every URL parameter on init and stores them in sessionStorage.
  2. Parameters persist across page navigation — once captured, they remain available for the rest of the session even if the next page does not include them.
  3. Visiting a new page with a different value for the same parameter overrides the stored one.
  4. You read parameters in conditionals as param.<name> and bind them to data-next-show / data-next-hide.
<!-- Hide reviews when ?reviews=n is in the URL -->
<div data-next-hide="param.reviews == 'n'">
  Customer testimonials
</div>

On this page