Script Conflicts
Guide to identifying and resolving conflicts between the Ours Privacy CMP and other scripts that manipulate the DOM or alter script execution, including Cloudflare Rocket Loader and other optimization tools.
Script Conflicts
The Ours Privacy CMP works by manipulating the DOM (the collection of elements that make up a webpage) to detect, block, and control script execution based on user consent. Scripts, frameworks, and addons that employ similar techniques can conflict with the CMP's ability to properly manage consent-based script loading.
Any script that manipulates the DOM or alters script execution timing can potentially interfere with the CMP. This includes optimization tools, caching plugins, and other third-party scripts that modify how or when scripts load and execute.
Cloudflare Rocket Loader
Rocket Loader is a Cloudflare product that loads JavaScript asynchronously to optimize page loading times. This asynchronous loading can conflict with the CMP's ability to detect and dynamically control which page elements are loaded and executed according to the website visitor's consent choices.
Recommended Solution
We recommend using Rocket Loader in manual mode to ensure that the Ours Privacy CMP controls which page elements are loaded and executed. Only use Rocket Loader to optimize elements that you are certain do not set any cookies or only set necessary cookies.
Configuration Steps
- In your Cloudflare dashboard, navigate to Performance Settings
- Set the Rocket Loader option to Manual
- If needed, manually mark up the elements that you wish to be loaded by Rocket Loader:
<script data-cfasync="true" src="https://example.org/js/"></script>Important: Scripts marked with
data-cfasync="true"will be able to set cookies regardless of the visitor's consent choices. Only mark up elements that do not set any cookies or only set necessary cookies.
Other Common Conflicts
Other optimization and caching tools that may cause similar conflicts include:
- WP Rocket (WordPress caching plugin)
- LiteSpeed Cache (WordPress optimization tool)
- Other script optimization plugins that defer, delay, or asynchronously load scripts
- Any custom scripts that manipulate script loading or execution timing
The same principles apply: any script that modifies when or how other scripts load can interfere with the CMP's consent-based blocking mechanism.
General Recommendations
Identify Potential Conflicts
- Review all scripts, plugins, and optimization tools on your site
- Look for tools that:
- Defer or delay script loading
- Load scripts asynchronously
- Modify script execution timing
- Manipulate the DOM to inject or modify scripts
Configuration Best Practices
- Exclude CMP scripts from optimization: Ensure the Ours Privacy CMP script is excluded from any optimization, minification, or caching processes
- Test thoroughly: After configuring optimization settings, test your website to ensure:
- The consent banner displays correctly
- Scripts are properly blocked before consent
- Scripts are enabled after consent is granted
- User preferences are respected
When in Doubt
If you're experiencing issues with script blocking or consent management:
- Temporarily disable optimization tools to see if the issue resolves
- Check browser developer tools to verify scripts are being blocked/enabled correctly
- Review your optimization tool settings to ensure CMP scripts are excluded
- Contact support@oursprivacy.com if you need assistance
Next Steps
- Script Blocking: Learn about automatic and manual script blocking
- Installation: Ensure proper script placement for blocking to work
- General Settings: Configure Services and categories for blocking
How is this guide?