Add the following code in app/layout.js. If you already have
a layout.js, you just need to add the Script
components and their corresponding import statement.
import Script from 'next/script'
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
{children}
<Script src="https://r.wdfl.co/rw.js" data-rewardful="f504d0"></Script>
<Script id="rewardful-queue" strategy="beforeInteractive">
{`(function(w,r){w._rwq=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}})(window,'rewardful');`}
</Script>
</body>
</html>
)
}
Copy
Add the following code in pages/_app.js. If you already have
a layout.js, you just need to add the Script
components and their corresponding import statement.
import Script from 'next/script'
export default function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<Script src="https://r.wdfl.co/rw.js" data-rewardful="f504d0"></Script>
<Script id="rewardful-queue" strategy="beforeInteractive">
{`(function(w,r){w._rwq=r;w[r]=w[r]||function(){(w[r].q=w[r].q||[]).push(arguments)}})(window,'rewardful');`}
</Script>
</>
)
}
Copy