DEV Community

Discussion on: Add Google Analytics through GTM (Google Tag Manager) on Next.js

Collapse
 
hukken profile image
Øystein Hukset

Hi. Great tip!
But I see a problem on my end using this method. The GTM script renders multiple times (for each Page Change). Does not matter if I use the Custom Event trigger or the History Change trigger.

Anybody else seeing this?

Collapse
 
oxodesign profile image
Flamur Mavraj

Sorry for late reply, no, haven't encounter this issue. Check if the component is rerendering and therefor firing multiple GTM page view events!