@Chardonneaur opened this Issue on February 27th 2021

When using https://validator.w3.org the Matomo Tag Manager code snippet is flagged as a warning.
Solution: please change

@Findus23 commented on February 27th 2021 Member

This is a fun "issue": In HTML5 javascript is the default for the <script> tag and therefore adding the type is redundand. The [standard]() even says:

Authors should omit the attribute, instead of redundantly giving a JavaScript MIME type.

But Matomo can't know that the website you paste the tracking (or tag manager) code into is a HTML5 page accessed with a modern browser.
It could also be an ancient website only used by IE8 users and in this case I think adding the type is required for the browser to know what scripting language to use for it.

So it might be worth it to add redundand information in 99% of cases to avoid breaking things in very rare cases.

You can of course feel free to remove the type in your website as it isn't needed when you use HTML5.

@tsteur commented on February 28th 2021 Member

Thanks for this @Chardonneaur . @Findus23 @Chardonneaur not sure if we should keep the issue open or close it? We wouldn't remove it for now while we support older browsers so tempted to close the issue and re-open when we drop support for older browsers maybe (which is unlikely to happen in the next 2-3 years).

Powered by GitHub Issue Mirror