Replies: 4 comments 4 replies
-
After playing with it for a bit, I noticed that I can use the
Any reason not to use this approach? |
Beta Was this translation helpful? Give feedback.
-
@ion-willo Have you resolved this? How did you integrate GTM to Remix? Did you manage to get the page views integrated without creating a custom triggers? |
Beta Was this translation helpful? Give feedback.
-
I ended up doing this in const navigation = useNavigation()
useEffect(() => {
if (navigation.state === 'loading') {
// console.log('*** Navigating to', navigation.location?.pathname)
// Put GTM trigger here
}
}, [navigation.location?.pathname]) |
Beta Was this translation helpful? Give feedback.
-
Great to know. I find Remix incredible, but it seems that Redix users typically do not need to integrate with Google Tag Manager. I guess typical GTM users are still using WordPress. So this discussion is precious. Thank you. Do you use standard triggers (Page Load, etc.), or do you have to define a custom trigger? Also, please provide some example code for manually triggering a trigger. |
Beta Was this translation helpful? Give feedback.
-
What is the new or updated feature that you are suggesting?
Allow user-defined code to be executed when a navigation event occurs, either on an SSR fetch or CSR event.
Why should this feature be included?
We need to send an event to Google Tag Manager to capture page views for analytics. Once Remix has been hydrated, navigation events will happen on the client and within Remix.
Beta Was this translation helpful? Give feedback.
All reactions