Skip to content

Add gtm tag#192

Open
fdsafewa wants to merge 5 commits intomainfrom
add-ga-tag
Open

Add gtm tag#192
fdsafewa wants to merge 5 commits intomainfrom
add-ga-tag

Conversation

@fdsafewa
Copy link
Collaborator

No description provided.

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.
@netlify
Copy link

netlify bot commented Feb 12, 2026

Deploy Preview for orcahome ready!

Name Link
🔨 Latest commit 524c233
🔍 Latest deploy log https://app.netlify.com/projects/orcahome/deploys/69992ee50f22b900086094bc
😎 Deploy Preview https://deploy-preview-192--orcahome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@fdsafewa
Copy link
Collaborator Author

Simple test for the Orcahome KPIs

@UXBrendan UXBrendan self-requested a review February 13, 2026 00:20
UXBrendan
UXBrendan previously approved these changes Feb 13, 2026
@benjifriedman
Copy link
Collaborator

This needs npm lint run before merging

@fdsafewa
Copy link
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.
@fdsafewa
Copy link
Collaborator Author

fdsafewa commented Feb 14, 2026

Fixed npm lint run failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants