What are query parameters?
Query parameters are a defined set of parameters (key-value pair) attached to the end of a URL used to provide additional information to a web server when making requests. They are an important part of the URL that define specific content or actions based on the data being passed.
To append query params to the end of a URL, a question mark (?) is added followed immediately by a query parameter. To add multiple parameters, an ampersand (&) is added in between each, joining them to form a query string parameter. These can be created by any variation of object types or lengths such as strings, arrays, and numbers. The following is an example:
https://example.com/path?name=Branch&products=[Journeys,Email,Universal%20Ads]
In this example, there are two query parameters:
- ‘name’ with the value “Branch”
- ‘products’ with the value “[Journeys,Email, Universal%20Ads]”
These parameters can be used to instruct the web server how to process the request, such as customizing the page based on the ‘name’ field or filtering products based on the ‘products’ list.
What are query parameters used for?
Query parameters serve various purposes, including:
- API requests: Mobile apps communicate with APIs, and developers can use API query parameters to filter, sort, or customize the data received by the app.
- Deep linking: Query parameters can be used in deep linking to pass information to an app to open a specific in-app screen.
- Search: For mobile apps that have search functionality, query parameters can be used to pass search queries to the app’s server or API.
- Tracking and attribution: Many mobile apps use query parameters to track user interactions and measure campaign effectiveness.
Although it’s important to note that query parameters can play a role in attribution, it’s also important to make sure that your attribution strategy is truly cross-platform, and that it’s doing everything for you that it can. Learn more about cross-platform attribution.