fix: ensure window.datalayer access in client only
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import "../../core.css";
|
||||
import "../../scandic.css";
|
||||
import "../../core.css"
|
||||
import "../../scandic.css"
|
||||
|
||||
import Footer from "@/components/Current/Footer";
|
||||
import LangPopup from "@/components/Current/LangPopup";
|
||||
import Script from "next/script";
|
||||
import SkipToMainContent from "@/components/SkipToMainContent";
|
||||
import Footer from "@/components/Current/Footer"
|
||||
import LangPopup from "@/components/Current/LangPopup"
|
||||
import Script from "next/script"
|
||||
import SkipToMainContent from "@/components/SkipToMainContent"
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import type { LangParams, LayoutArgs } from "@/types/params";
|
||||
import type { Metadata } from "next"
|
||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||
import { env } from "@/env/server.mjs"
|
||||
export const metadata: Metadata = {
|
||||
description: "New web",
|
||||
@@ -15,6 +15,7 @@ export const metadata: Metadata = {
|
||||
}
|
||||
|
||||
const adobeSrcs = {
|
||||
// TODO: decide on naming and environments
|
||||
development: "",
|
||||
test: "https://assets.adobedtm.com/c1bd08b1e4e7/d64a7c1f5f17/launch-84c70d82a50c-staging.min.js",
|
||||
production:
|
||||
@@ -72,7 +73,14 @@ export default function RootLayout({
|
||||
`}
|
||||
</Script> */}
|
||||
{/* TODO: Ensure order (datalayer created before script is executed!) */}
|
||||
{/* Should this be moved to an app/layout instead? */}
|
||||
<Script id={"before"}>{`
|
||||
console.log('before script load')
|
||||
`}</Script>
|
||||
<Script src={adobeSrcs[env.NODE_ENV]} />
|
||||
<Script id="after">{`
|
||||
console.log('after script load')
|
||||
`}</Script>
|
||||
{/* <Script
|
||||
data-cookieconsent="ignore"
|
||||
src="/Static/dist/js/main-ng.js?336b801d6b38eff10884"
|
||||
@@ -86,5 +94,5 @@ export default function RootLayout({
|
||||
<Footer lang={params.lang} />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user