Google tag manager is not showing when click on "View Source" in browser.
Unanswered
Istrian Coarse-haired Hound posted this in #help-forum
Istrian Coarse-haired HoundOP
I have set GTM code in my NextJs applicaiton, gtm is applied correctly when i see in "Inspect Elements".
But my seo person told me that gtm code should be visible when we do "View Source" in browser window.
Is there any issue with build? i am creating build using "Standalone" options
But my seo person told me that gtm code should be visible when we do "View Source" in browser window.
Is there any issue with build? i am creating build using "Standalone" options
next build && cp -r .next/static .next/standalone/.next/ && cp -r public .next/standalone/ after build i am copy public assets and then i deploy only standalone folder to production server also i am using node ./.next/standalone/server.js to start my project on Azure.4 Replies
Istrian Coarse-haired HoundOP
hi is anyone there to help me?
Western paper wasp
Please show some of your source code of how you’re adding GTM to your Next.js application.
We can’t tell what your problem is just from looking at screenshots of your browser devtools.
Istrian Coarse-haired HoundOP
This my RootLayout
Below is my Layout file which is inside of RootLayout
i am reading analytics code dynamically so i have to keep them inside of redux store. @Western paper wasp please let me know if you need anything else.
<html suppressHydrationWarning>
<head>
<meta charSet="utf-8"/>
</head>
<body>
<PrimeReactProvider value={value}>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<Interceptor store={store}>{children}</Interceptor>
</PersistGate>
</Provider>
</PrimeReactProvider>
</body>
</html>Below is my Layout file which is inside of RootLayout
<>
<noscript>
<iframe src={'https://www.googletagmanager.com/ns.html?id=${settings.bodyScript}'}
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<GoogleAnalytics gaId={settings.analyticsCode}/>
<GoogleTagManager gtmId={settings.gtmCode}/>
<Layout>{children}</Layout>
</>i am reading analytics code dynamically so i have to keep them inside of redux store. @Western paper wasp please let me know if you need anything else.