title: Listen to route change with next.js to use with matomo/piwik
body: <p>I'm trying to listen to route changes on a next.js app, in order to log navigation to matomo (aka piwik). According to next.js' documentation, I have to do something like this:</p>
  
  <pre><code>Router.events.on('routeChangeStart', url =&gt; {
    // Do something
  });
  </code></pre>
  
  <p><strong>Where</strong> do I have to use this code in my app in order to log all the route change events?</p>
  
  <p>(<em>"where"</em> means in which file/class/method)</p>