Introduction

In this article, we shall look at URL params. URL params are key-value pair values that are passed along a URL to be derived from the HTTP Resource being consumed.

Example URL

a code snippet screenshot

Where are URL parameters used:

  1. Identifying specific resource: A URL parameter can be used to specify the unique identifier of a resource, such as a product or user, to retrieve its details. Example: https://www.example.com/product?id=123

  2. Filtering results: URL parameters can be used to filter results, for instance to search for specific items or to display specific categories. Example: https://www.example.com/products?category=books&search=harry+potter

  3. Setting preferences: URL parameters can also be used to set user preferences, such as sorting or display options. Example: https://www.example.com/products?sort=price&order=asc

  4. Tracking information: URL parameters can also be used for tracking purposes, such as to identify the source of a referral or to track user behavior. Example: https://www.example.com/?utm_source=google&utm_medium=cpc&utm_campaign=summer_sale