Pull the analytics.js script from CDN




Wordpress LScache Plugin: Pull the analytics.js script from CDN

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, Im using the following plugin https://wordpress.org/plugins/host-analyticsjs-local/ to host Googles analytics.js locally. My GTMetrix performance report tells me: There is 1 static component that is not on CDN https://mywebsite.com/wp-content/cache/caos-analytics/analytics.js How do I add analytics.js to my CDN? Please advise, thank you! Hi @relle, Have you already put the resources to your CDN? If yes you go to LiteSpeed Cache > Settinn > CDN to set you CDN path for serving the file. Hi, I only see the Exclude Path. Am I missing something? I enabled CDN and add my CDN URL. And all my static files are served over CDN except for the Google Analytics analytics.js file. Thanks! Hi @relle, could you please provide your Report Number, you can found it in?WP Admin > LiteSpeed Cache > Report. Hi, Report number: FNKCPZPM Thanks for your help. Hi @relle, we found that the analytics.js is inserted by JS code (which you can check from the response on inspector > network) and our plugin is not handling rewrite CDN under JS script. You may need to check with your GA plugin provider or update your code for inserting you script by CDN.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference