Skip to main content

Next.js

Steps to install snippet on a Next.js site

  • Copy the JS snippet from Data Collection under settings
  • And paste into corresponding file as shown below:
app/layout.jsx
import Script from "next/script";

export default function Layout({ children }) {
return (
<html lang="en">
<body>
{children}
<Script
id="syft_script"
dangerouslySetInnerHTML={{
__html: `{JS_SNIPPET}`,
}}
/>
</body>
</html>
);
}