next.js
next.js copied to clipboard
Update GTM/Analytics example app to use single layout.js
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Hi there,
Trying out new app directory and looking for a proper way of configuring Google Tag Maanger.
Found something in the example app: https://github.com/vercel/next.js/tree/canary/examples/with-google-tag-manager
But it still uses _app and _document, to be more specific _ app has import { useEffect } from 'react'
which will require to add another line 'use client'
.
Keeping in mind that these two files should be migrated into layout.js adding 'use client' is not recommended.
So what is the best way to implement GTM in NextJS 13?
Which example does this report relate to?
with-google-tag-manager
What browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
npm run dev
Describe the Bug
outdated documentation
Expected Behavior
should be updated to use layout.js
To Reproduce
n/a