Migration Process from GTM to MTM
Tags, triggers, and variables created in Google Tag Manager (GTM) cannot be transferred to Matomo Tag Manager (MTM) with a single click. Therefore, the migration process must be done manually. Each tag, trigger, and variable needs to be recreated individually in the MTM panel.
Although GTM and MTM share similar building blocks, some features are not exactly the same. For example, tag types and trigger options are mostly comparable, but variable management and testing/preview functionalities may differ between platforms.
The table below compares the core building blocks of GTM and MTM side by side:
| Feature | Google Tag Manager (GTM) | Matomo Tag Manager (MTM) |
| Tag Management | Ready-made templates and popular integrations | Customizable tags, API-supported |
| Triggers | Click, page view, form submission, etc. | Similar trigger types with additional testing options |
| Variables | Default and custom variables | Default, custom, and data layer-supported variables |
| Testing & Preview | Preview mode available | Advanced preview and version control available |
| Data Storage | On Google servers | On your own server with full data privacy control |
This structure allows you to manually migrate each tag to MTM while leveraging similar building blocks to create a fast and error-free workflow during the migration process.
Migration Examples: From GTM to MTM
Providing examples of commonly used tags and triggers during the migration from GTM to MTM helps make the process easier to understand. Below is a step-by-step guide with illustrative instructions.
Scroll Tracking
In GTM:
Tags are created using a Scroll Depth Trigger, firing at specific points such as 25%, 50%, 75%, and 100% of the page.In MTM:
A similar trigger type, Scroll Depth Trigger, is selected, and the same percentages and firing conditions are manually configured.Benefit:
Accurately analyze user engagement and page content performance.
Custom HTML Usage
In GTM: A Custom HTML Tag is added for custom JavaScript or HTML code.
In MTM: The same code is added using Custom Tag or Custom HTML in the MTM panel and assigned a trigger.
Benefit: Provides flexibility for custom tracking, third-party integrations, or adding scripts.
Using JavaScript Variables
In GTM: A JavaScript Variable is defined and used in tags.
In MTM: A Custom JavaScript Variable is added to dynamically use the same value across tags.
Benefit: Automatically updates all tags when the variable value changes.
Form Tracking
In GTM: Forms are tracked using a Form Submission Trigger.
In MTM: A Form Submission Trigger is created, specifying which forms to track and the triggering conditions.
Benefit: Simplifies conversion and user interaction analysis.
Page View Tracking
In GTM: Each page load is tracked using a Page View Trigger.
In MTM: A Page View Trigger is added, with triggering based on page URL, path, or title.
Benefit: Essential for page-level visitor analysis and SEO reporting.
Hotjar Implementation
In GTM: Hotjar Tracking Code is added via a Custom HTML Tag and assigned a trigger.
In MTM: Hotjar script is added as a Custom HTML Tag in MTM and linked to a trigger.
Benefit: Enables monitoring of user experience and heatmap analytics directly in the Matomo panel.