Using the consent solution with caching/optimization tools - Perfmatters, WP Rocket, NitroPack, SG (SiteGround) Optimizer, LiteSpeed

Modified on Mon, 9 Feb at 4:46 PM

If you are using Perfmatters, WPRocket, Nitro Pack, or the SG Optimizer plugin with JavaScript minification enabled, you may have embedding issues with the cookie consent solution. You will need to exclude the Usercentrics files so that it can function correctly and control all non-essential scripts on your website. 


Go to your plugin settings where you have javascript minification enabled, and locate the area to exclude files from the javascript minification feature.


If you have "Minify JavaScript Files" enabled and/or "Defer JavaScript Files" enabled, then add to "Exclude JavaScript Files" the following code:


app.usercentrics.eu/browser-ui/latest/loader.js
privacy-proxy.usercentrics.eu/latest/uc-block.bundle.js
termageddon-usercentrics
termageddon
usercentrics
HTML

Save changes, then clear cache, and then visit the website in incognito to verify everything is working (or test on another browser and/or device).


For perfmatters, you need to both defer AND delay JS, and exclude the userscentrics script like in the image below:

Also, for Perfmatters, please add the following to be excluded from delay (and 'excluded from defer'):

termageddon-usercentrics


For NitroPack, SG Optimizer and/or WP Rocket, you can also turn off Javascript Minifier which will also resolve the issue. 

For LiteSpeed Cache, check to see if Guest Mode was turned on in the CDN. If yes, turn to off and this should resolve the issue. Also for LiteSpeed, "Advanced" may alter the Usercentrics script, however "Basic" and "Essential" appear to be compatible settings.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article