How to Block CMP script
Introduction
Blocking an intrusive CMP script can be difficult when it disrupts your website’s functionality and user experience. Frequent pop-ups and performance slowdowns caused by the script can frustrate both users and developers.
Requestly provides a solution by allowing you to easily block these scripts, ensuring a smoother user experience without the constant interruptions.
Block CMP Script
The Cancel Request Rule
in Requestly allows you to prevent a CMP script from loading by blocking its requests. This is especially useful for improving site performance and user experience without disrupting live operations.
- Source Condition: This is where you decide which requests to
Block
orcancel
. In the example, any request that containsexample.com
in the URL will be affected. - Test URL Condition: You can check if the rules you’ve set up work correctly by testing them on specific URLs.
- Filter Out Condition: You can apply
filters
to limit which requests are affected, making sure only the ones you want are modified.
Or create your own Rule
by following the steps below
Here’s how to set up a cancel request rule to prevent a CMP script from loading on your website:
- Open Requestly:Open the Requestly app.
- Create a New Rule: Click on
New Rule
and selectCancel Request.
- Enter the CMP Script URL Pattern: Add the URL pattern for the CMP script you want to block.
- Example URL:
https://example.com/cmp.js
- Example URL:
- Save the Rule: Click
Save
to create.
Interactive Guide
Check this interactive and easy explanation of how to create  Cancel Request Rule.
Conclusion
Try this Cancel Request rule to prevent CMP scripts from loading, allowing you to test and troubleshoot without interference from consent management processes. Requestly is trusted by over 200k developers and 1000+ corporates for its reliability in managing network requests efficiently.
Explore More: