How do I synchronise events from the GTM dataLayer to the MTM dataLayer?
By default, Matomo Tag Manager (MTM) copies any existing values from the Google Tag Manager (GTM) data layer into the MTM data layer when the page loads. It does not monitor any new events in the GTM data layer after this initial load.
Starting with Matomo 5.2.0-b3, there is a container setting that allows GTM data layer events to be actively synchronised to the MTM data layer. Previously, there was no built-in way to do this. A community member provided this example of how to synchronise events from the GTM layer, by updating the code on your website. Using the example, we successfully implemented the new setting. To prevent a sudden change in system behaviour, the new setting is off by default for existing MTM containers and set to on when creating new containers.
If you want this setting enabled, you can edit your existing containers in MTM. Simply go to the Manage Containers screen and click the Edit Container button next to the container you want to update. The setting should be shown in the edit form. Simply check the box and click the Update button to save your changes.