Pageview duplicates each visit to a page

-no errors in the browser console

  • this is the whole code to install MTM
<script
            type="text/javascript"
            dangerouslySetInnerHTML={{
              __html: `var _mtm = window._mtm = window._mtm || [];
              _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
              var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
              g.async=true; g.src='https://cdn.matomo.cloud/XXXXXXX/container_${NEXT_PUBLIC_MATOMO_CONTAINER_ID}.js'; s.parentNode.insertBefore(g,s);`,
            }}
          ></script>
  • I do not use any _paq variable in any part of my application, however I am using the ‘@socialgouv/matomo-next’ package in order to be able to track the different URLs of my application (since in nextjs they are considered a single page app)
  • I use only 1 Matomo configuration variable (that is the same for all the containers)
  • also the pageview trigger and tags are the same (for the DEV container more tags and triggers are being tested today, so you will see some differences, but the tags and triggers for the pageview of matomo Analytics are the same)