CDN-hosted piwik,js

Is it supported to host the piwik.js file in a CDN (with a different domain)?
Is it ok to just replace the URL on the tracking code or is anything else needed?

Does the .js file change in every update?

Thanks

It should be possible. You’ll only need to update the URL in the tracking code (so g.src = u + 'piwik.js'; should become g.src = 'https://cdn.example/piwik.js')

Yes it is possible that there are changes on every update. Also keep in mind, that plugins are able to add their own scripts to piwik.js, so check if the file on CDN is the same as it would be delivered by piwik.