Open
Conversation
Import next/script and add Google Analytics (gtag) to src/pages/_app.tsx. The change loads gtag.js with strategy "afterInteractive" and injects an initialization script that sets up window.dataLayer and calls google tag to enable page tracking.
Remove client-side gtag Script usage from _app.tsx and add Google Tag Manager snippets to _document.tsx. The head now includes the GTM script via dangerouslySetInnerHTML and the body contains the noscript iframe for GTM-TTS69V9J. Also remove the unused next/script import in _app.tsx. This ensures GTM is injected at the document level (head and body) and supports noscript usage.
✅ Deploy Preview for orcahome ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Collaborator
Author
|
Simple test for the Orcahome KPIs |
UXBrendan
previously approved these changes
Feb 13, 2026
Collaborator
|
This needs |
Collaborator
Author
|
I will fix that later. |
Use Next.js Script in src/pages/_app.tsx to load Google Tag Manager after hydration instead of injecting a raw script in _document.tsx. The GTM init snippet was added with strategy="afterInteractive" and Script import was added to _app. The inline dangerouslySetInnerHTML script was removed from _document, and the noscript iframe in _document was given a title attribute for accessibility. GTM container ID is unchanged.
Collaborator
Author
|
Fixed npm lint run failed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.