fix: adjust datalayer behavior

This commit is contained in:
Arvid Norlin
2024-02-16 15:14:16 +01:00
parent 8b87267eda
commit 60e2c8ae45
3 changed files with 22 additions and 22 deletions

View File

@@ -11,5 +11,13 @@ const scriptScrs = {
}
export default function AdobeScript() {
return <Script src={scriptScrs[env.NODE_ENV]} />
return (
<>
<Script
strategy="beforeInteractive"
id="ensure-datalayer"
>{`window.datalayer = window.datalayer || {}`}</Script>
<Script src={scriptScrs[env.NODE_ENV]} />
</>
)
}