AmazingDreams / vue-matomo

Vue plugin for Matomo Analytics
MIT License
274 stars 61 forks source link

Crossorigin anonymous load script option #110

Closed AdamSGit closed 2 years ago

AdamSGit commented 2 years ago

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 :

Cheers

jordan-boyer commented 2 years ago

Hello, You can do a PR about this it will be awesome.

I think the best approve will be to add an option.

AdamSGit commented 2 years ago

You got it. PR is up ! Cheers

AmazingDreams commented 2 years ago

Thanks @AdamSGit !