title: GTM with NextJs
body: <p>Having troubles registering route change events on NextJs (SSR enabled) app.
  I am using the <strong>History Change</strong> event trigger in GTM.</p>
  
  <p>Using the <strong>react-gtm-module</strong> to initialise the Google Tag Manager.</p>
  
  <p>Issue: The event fires on mount, with route eg. www.site.com/product/123
  But the event does NOT fire when from the page /product/123/ I navigate to a page like /product/124/.</p>
  
  <p>Product page:</p>
  
  <pre><code>return (
  &lt;div&gt;
    &lt;div&gt;{props.title}&lt;/div&gt;
    &lt;Link href="/product/[pid]" as={`/product/124`}&gt;
      &lt;a&gt;Another product (should trigger event here, but doesn't)&lt;/a&gt;
    &lt;/Link&gt;
  &lt;/div&gt;
  )
  </code></pre>
  
  <p>I have tried adding this to _app.js (componentDidMount)</p>
  
  <pre><code>     import Router from 'next/router';
        ...
        componentDidMount () {
        ...
        if (process.browser) {
        Router.onRouteChangeComplete = url =&gt; {
          window.history.pushState({}, document.title, url);
        };
      }
  </code></pre>
  
  <p>What is the proper way of doing this in NextJs?</p>