fix: remove async script attribute
using async and defer on script tags is considered an [antipattern](https://almanac.httparchive.org/en/2022/javascript#async-defer-module-and-nomodule) as defer will be ignored. Defer is the preferred behaviour in most situations.pull/1731/head
parent
796c65fa29
commit
258e8bb3d6
|
@ -5,7 +5,7 @@ import { Form, FormRow, TextArea } from 'react-basics';
|
||||||
export default function TrackingCodeForm({ websiteId }) {
|
export default function TrackingCodeForm({ websiteId }) {
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
const { trackerScriptName } = useConfig();
|
const { trackerScriptName } = useConfig();
|
||||||
const code = `<script async defer src="${trackerScriptName}" data-website-id="${websiteId}"></script>`;
|
const code = `<script defer src="${trackerScriptName}" data-website-id="${websiteId}"></script>`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -50,7 +50,6 @@ export default function TestConsole() {
|
||||||
<Head>
|
<Head>
|
||||||
{typeof window !== 'undefined' && website && (
|
{typeof window !== 'undefined' && website && (
|
||||||
<script
|
<script
|
||||||
async
|
|
||||||
defer
|
defer
|
||||||
data-website-id={website.id}
|
data-website-id={website.id}
|
||||||
src={`${basePath}/umami.js`}
|
src={`${basePath}/umami.js`}
|
||||||
|
|
Loading…
Reference in New Issue