The loadScript util method generate this import for matomo.js :
<script async="" defer="" src="https://domain.com/matomo.js"></script>
In case the domain isn't the same as the one that load the script, not having the possibility to add the tag crossorigin="anonymous" could cause CORS issues. Additionally, if errors are thrown in the matomo script, this will be catched by the onError method as "Script error.", making debugging hard.
Do you want me to do that and make a PR ? If so, which stategy should be adopted between :
Add an option to add the attribute no matter if the domain is the same
Auto detecting different domain, and add it automatically
The
loadScript
util method generate this import formatomo.js
:<script async="" defer="" src="https://domain.com/matomo.js"></script>
In case the domain isn't the same as the one that load the script, not having the possibility to add the tag
crossorigin="anonymous"
could cause CORS issues. Additionally, if errors are thrown in the matomo script, this will be catched by theonError
method as "Script error.", making debugging hard.Do you want me to do that and make a PR ? If so, which stategy should be adopted between :
Cheers