Using Requestly, you can modify the query parameters (query params) sent to the server. This includes adding new query params, updating the values of existing params, or removing specific or all query params from the URL. The following sections explain the steps and common scenarios for modifying query params.
Why Use Modify Query Parameters Rule
-
Remove UTM Tracking Parameters: Automatically strip out UTM tags from URLs to ensure cleaner analytics data.
-
Burst Cache Using Query Params: Append a versioning query param (e.g.,
?v=2
) to the URL to bypass caching and fetch fresh data. -
Send Additional Information to APIs: Add custom parameters to API calls, such as indicating internal testing (e.g.,
?testing=true
).
How to Modify Query Params
Open HTTP Rules and Create a New Rule
Navigate to the HTTP Rules section in the Requestly web or desktop app. Click on the + New Rule button and select Modify Query Params from the list of options.
Define the Rule Name and Description
Provide a descriptive name for the rule to keep your setup organized. Optionally, add a description to explain the purpose of the rule for easier identification.
For example, a name like "Remove UTM Tags" can help quickly understand the rule’s objective.
Define the Source Condition
Source Condition specifies the criteria for matching requests. You can target requests using the following attributes:
-
URL, Host, or Path: Define what part of the request should be matched.
-
Operators: Choose from Regex, Contains, Wildcard, or Equals to apply precise matching logic.
For more detailed guidance, refer to the Source Conditions Guide.
For example, you can target URLs containing ?utm_
to remove UTM tracking parameters. These source conditions ensure the rule activates only for relevant requests.
Perform Query Param Modifications
-
Add Query Params: Specify the key and value to be appended to the URL.
-
Remove Query Params: Enter the names of query parameters to delete, or select the option to remove all parameters.
-
Override Query Params: Update an existing parameter’s value by specifying its key and new value. This flexibility lets you customize query parameters for varied scenarios like versioning or testing.
Save and Activate the Rule
Click Save to store the rule and toggle it ON to activate. Activating the rule ensures it applies to all requests matching the defined source conditions, dynamically modifying URLs as specified.
Test the Rule
Use the Test option to verify the rule’s functionality. Enter a test URL to view the modified URL with applied changes in query parameters. This helps confirm the rule’s effectiveness before deployment.