docs(nx-dev): add Google Tag Manager script (#30977)
Integrated Google Tag Manager (GTM) with both script and noscript tags for analytics tracking. Ensured the script uses `afterInteractive` loading strategy and includes dynamic `gaMeasurementId` for proper configuration.
This commit is contained in:
parent
95652aef88
commit
a3415309b9
@ -131,6 +131,29 @@ export default function CustomApp({
|
|||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Script
|
||||||
|
id="gtm-script"
|
||||||
|
strategy="afterInteractive"
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
|
})(window,document,'script','dataLayer','${gaMeasurementId}');
|
||||||
|
`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/* Google Tag Manager - NoScript */}
|
||||||
|
<noscript>
|
||||||
|
<iframe
|
||||||
|
src={`https://www.googletagmanager.com/ns.html?id=${gaMeasurementId}`}
|
||||||
|
height="0"
|
||||||
|
width="0"
|
||||||
|
style={{ display: 'none', visibility: 'hidden' }}
|
||||||
|
/>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
{/* Apollo.io Embed Code */}
|
{/* Apollo.io Embed Code */}
|
||||||
<Script
|
<Script
|
||||||
type="text/javascript"
|
type="text/javascript"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user