Custom event triggered only on debug mode

We are testing matomo for a customer who was on GA4 (managed by ourselves).
We have switched the customer’s site to SPA. As a result, we have installed the matomo tag manager.
We are experiencing several problems:

  1. the tutorial provided by matomo for SPAs did not allow us to have a correct configuration, pageviews are triggered multiple times instead of once. They are also triggered too early, preventing access to the pagetitle variable.
  2. We therefore created a custom trigger called in js for each pageload: _mtm.push({“event”: “pageview”});
    In debug mode, the tag is triggered and appears in the matomo data, but in duplicate. However, without debug mode, pageviews are no longer displayed.

This is the website :

Hi @Geoffroy

Are you sure you deployed the new version of the container? Is there no cache problem? In the browser network console, you can check some checkbox to disable the cache (when the browser developer tool is open).