formerly I was using react-ga npm module to insert google analytics in my next js app. and It was simply like this:
import ReactGA from \'react-ga\' export cons
Im using react-gtm-module and config in _app.js inside componentDidMount
_app.js
componentDidMount
componentDidMount() { const tagManagerArgs = { gtmId = 'GTM-00001' } TagManager.initialize(tagManagerArgs); }
this is my solution updated at Feb 11, 2020