{"id":14724,"date":"2026-01-19T13:06:15","date_gmt":"2026-01-19T13:06:15","guid":{"rendered":"https:\/\/e-dialog.group\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/"},"modified":"2026-02-27T15:34:24","modified_gmt":"2026-02-27T15:34:24","slug":"gtm-ga4-datalayer-in-matomo-tracking-the-easy-way","status":"publish","type":"post","link":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/","title":{"rendered":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!"},"content":{"rendered":"<div id=\"basic-content-block_7e5978ff7009a180e074cda8b4aa539a\" class=\"basic-content block block--basic-content block--no-margin\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <p>If you use <a href=\"https:\/\/e-dialog.group\/en\/google-sales-partner\/google-tag-manager-360\/\">Google Tag Manager (GTM)<\/a> and <a href=\"https:\/\/e-dialog.group\/en\/google-sales-partner\/google-analytics-360\/\">Google Analytics 4 (GA4)<\/a>, you have probably already implemented a robust Datalayer on your website. This Datalayer collects important data such as clicks, form submissions, or e-commerce interactions. The good news? You don&rsquo;t have to rebuild this system if you want to use Matomo in addition or instead.   <\/p>\n<p>In this article, you will learn how to automatically use your existing GA4 Datalayer for Matomo. This saves time, avoids redundancy, and ensures that your data is consistent across both systems. <\/p>\n<p>&nbsp;<\/p>\n<h2>The Role of the Datalayer in Web Tracking<\/h2>\n<p>A Datalayer serves as a temporary data store on a website. It is a JavaScript object that collects information about user interactions and makes it accessible to tag management systems. Instead of creating manual scripts for each action, data is &ldquo;pushed&rdquo; into the Datalayer in a standardized format. Tag managers like GTM or Matomo can then retrieve this data and send it to the respective analytics tools.   <\/p>\n<p>Using a Datalayer offers the following advantages:<\/p>\n  <\/div>\n<\/div>  <div id=\"small-ul-block_102fb3ab62279eac65aad6912e2dc2b9\" class=\"small-ul block block--small-ul small-ul--one-column\" data-title=\"\">\n    <ul class=\"small-ul__content content\">\n              <li class=\"content__li li\">\n                      <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\">\n              <circle fill=\"#0045a5\" cx=\"12\" cy=\"12\" r=\"11.77\"><\/circle>\n              <polyline fill=\"none\" stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" points=\"18 7.25 11 16.75 6 12.75\"><\/polyline>\n            <\/svg>\n            <strong>Consistency<\/strong>: All tags access the same data source.                  <\/li>\n              <li class=\"content__li li\">\n                      <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\">\n              <circle fill=\"#0045a5\" cx=\"12\" cy=\"12\" r=\"11.77\"><\/circle>\n              <polyline fill=\"none\" stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" points=\"18 7.25 11 16.75 6 12.75\"><\/polyline>\n            <\/svg>\n            <strong>Flexibility<\/strong>: Tags can be added or modified without changes to the website code.                  <\/li>\n              <li class=\"content__li li\">\n                      <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewbox=\"0 0 24 24\">\n              <circle fill=\"#0045a5\" cx=\"12\" cy=\"12\" r=\"11.77\"><\/circle>\n              <polyline fill=\"none\" stroke=\"#fff\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" points=\"18 7.25 11 16.75 6 12.75\"><\/polyline>\n            <\/svg>\n            <strong>Efficiency<\/strong>: Tracking implementation becomes centralized and scalable.                  <\/li>\n          <\/ul>\n  <\/div>\n<div id=\"basic-content-block_c96a6fb44abe19e626df345a21ee3794\" class=\"basic-content block block--basic-content\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <h2>The Challenge of Datalayer Compatibility<\/h2>\n<p>Google Tag Manager uses the Datalayer with the standard name <span style=\"color: #196c85;\">dataLayer<\/span>, while Matomo uses its own Datalayer named <span style=\"color: #196c85;\">_mtm<\/span>. Manually duplicating data into both Datalayers involves double the effort and an increased risk of errors. <\/p>\n<p>In Matomo, the following option can be activated when creating a container:<\/p>\n  <\/div>\n<\/div><div id=\"image-fullscreen-block_8518ebb7f49cb21eec5b2fb32476e8c4\" class=\"image-fullscreen block block--image-fullscreen\" data-title=\"\">\n  <div class=\"image-fullscreen__content content\">\n    <img loading=\"lazy\" decoding=\"async\" width=\"1123\" height=\"128\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1.png\" class=\"content__img img img--desktop\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1.png 1123w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-300x34.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-1024x117.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-768x88.png 768w\" sizes=\"auto, (max-width: 1123px) 100vw, 1123px\">    <img loading=\"lazy\" decoding=\"async\" width=\"1123\" height=\"128\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1.png\" class=\"content__img img img--mobile\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1.png 1123w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-300x34.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-1024x117.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_1-768x88.png 768w\" sizes=\"auto, (max-width: 1123px) 100vw, 1123px\">  <\/div>\n<\/div><div id=\"basic-content-block_e7fd0c4dbbe37c1017075a38d1cb4cf6\" class=\"basic-content block block--basic-content block--no-margin\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <p>However, this option does not always seem reliable and does not always synchronize all events.<\/p>\n<p>If the option does not work reliably, there is a script to solve this problem that enables automatic synchronization of both Datalayers.<\/p>\n<p>&nbsp;<\/p>\n<h2>The Solution: Datalayer Synchronization via Script<\/h2>\n<p>The following script synchronizes the Datalayers by forwarding every push() command in the GTM Datalayer directly to the Matomo Datalayer. The script should be placed on the website before the Matomo tracking code, ideally directly after the GTM container code. It can also be integrated into a Custom HTML Tag within Matomo.  <\/p>\n  <\/div>\n<\/div><div id=\"image-fullscreen-block_1e898790994b2f97755881fd04c3d4ec\" class=\"image-fullscreen block block--image-fullscreen\" data-title=\"\">\n  <div class=\"image-fullscreen__content content\">\n    <img loading=\"lazy\" decoding=\"async\" width=\"1239\" height=\"893\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT.png\" class=\"content__img img img--desktop\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT.png 1239w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-300x216.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-1024x738.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-768x554.png 768w\" sizes=\"auto, (max-width: 1239px) 100vw, 1239px\">    <img loading=\"lazy\" decoding=\"async\" width=\"1239\" height=\"893\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT.png\" class=\"content__img img img--mobile\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT.png 1239w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-300x216.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-1024x738.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/gtm-ga4-matomo_SCRIPT-768x554.png 768w\" sizes=\"auto, (max-width: 1239px) 100vw, 1239px\">  <\/div>\n<\/div><div id=\"image-fullscreen-block_ad13290ce7c969896ce119f5133d2f88\" class=\"image-fullscreen block block--image-fullscreen\" data-title=\"\">\n  <div class=\"image-fullscreen__content content\">\n    <img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"1103\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3.png\" class=\"content__img img img--desktop\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3.png 877w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-239x300.png 239w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-814x1024.png 814w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-768x966.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\">    <img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"1103\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3.png\" class=\"content__img img img--mobile\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3.png 877w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-239x300.png 239w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-814x1024.png 814w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_3-768x966.png 768w\" sizes=\"auto, (max-width: 877px) 100vw, 877px\">  <\/div>\n<\/div><div id=\"basic-content-block_09553ce2ac2e1c2d48c82f5316b26620\" class=\"basic-content block block--basic-content\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <h2>How the Script Works<\/h2>\n<ol>\n<li><strong>Datalayer Initialization:<\/strong> The script ensures the existence of both Datalayers (<span style=\"color: #196c85;\">dataLayer<\/span> and <span style=\"color: #196c85;\">_mtm<\/span>).<\/li>\n<li><strong><span style=\"color: #196c85;\">Replace push<\/span> method:<\/strong> The original <span style=\"color: #196c85;\">push<\/span> method of the <span style=\"color: #196c85;\">dataLayer<\/span> array is saved and replaced by a new function.<\/li>\n<li><strong>Synchronization:<\/strong> The new <span style=\"color: #196c85;\">push<\/span> function checks whether the pushed object contains an <span style=\"color: #196c85;\">event<\/span>. If so, the object is additionally written to the Matomo Datalayer <span style=\"color: #196c85;\">_mtm<\/span>. Subsequently, the original <span style=\"color: #196c85;\">push<\/span> method is called to avoid affecting the functionality of any implemented GTM container.  <\/li>\n<li><strong>Processing of pre-existing entries:<\/strong> A <span style=\"color: #196c85;\">forEach<\/span> loop processes events already present in the <span style=\"color: #196c85;\">dataLayer<\/span>, if the script is loaded after them.<\/li>\n<\/ol>\n  <\/div>\n<\/div><div id=\"image-fullscreen-block_f1a28ef962639054012ca37de76cc001\" class=\"image-fullscreen block block--image-fullscreen\" data-title=\"\">\n  <div class=\"image-fullscreen__content content\">\n    <img loading=\"lazy\" decoding=\"async\" width=\"1134\" height=\"1008\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2.png\" class=\"content__img img img--desktop\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2.png 1134w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-300x267.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-1024x910.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-768x683.png 768w\" sizes=\"auto, (max-width: 1134px) 100vw, 1134px\">    <img loading=\"lazy\" decoding=\"async\" width=\"1134\" height=\"1008\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2.png\" class=\"content__img img img--mobile\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2.png 1134w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-300x267.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-1024x910.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4datalayer-Matomo_2-768x683.png 768w\" sizes=\"auto, (max-width: 1134px) 100vw, 1134px\">  <\/div>\n<\/div><div id=\"basic-content-block_4c4f322b933081f9861a4d50f4592011\" class=\"basic-content block block--basic-content\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <h2>Configuration in Matomo Tag Manager<\/h2>\n<p>After implementing the script, the corresponding tags and triggers must be configured in Matomo Tag Manager (MTM). The event names from the GA4 Datalayer are now available in the Matomo Datalayer. <\/p>\n<h3>1. Create Trigger<\/h3>\n<p>In Matomo Tag Manager, a new trigger of the type &ldquo;Datalayer Event&rdquo; is created. The Datalayer event name must exactly match the <span style=\"color: #196c85;\">event<\/span> name from the GA4 Datalayer (e.g., <span style=\"color: #196c85;\">add_to_cart, purchase<\/span>). <\/p>\n<h3>2. Define Variables<\/h3>\n<p>Datalayer variables are created for the transfer of additional data. The variable name must correspond to the key in the Datalayer (e.g., <span style=\"color: #196c85;\">page_location<\/span>, <span style=\"color: #196c85;\">ecommerce.items.0.item_name<\/span>). <\/p>\n<h3>3. Configure Tag<\/h3>\n<p>A Matomo Analytics Tag would then still need to be created. It is linked to the previously defined trigger, and the Datalayer variables are assigned to the corresponding Matomo fields (e.g., <span style=\"color: #196c85;\">Event Category<\/span>, <span style=\"color: #196c85;\">Event Action<\/span>). <\/p>\n<p>Through this configuration, the Matomo tags are automatically triggered and populated with the same data that is also used for GA4.<\/p>\n  <\/div>\n<\/div><div id=\"basic-content-block_203ca9d9b107afb63f9a35a6a4a559ef\" class=\"basic-content block block--basic-content\" data-title=\"\">\n  <div class=\"basic-content__content content\">\n    <h2>Conclusion<\/h2>\n<p>The synchronization of the GTM and Matomo Datalayers represents an efficient method to unify the tracking infrastructure. It reduces the <a href=\"https:\/\/e-dialog.group\/en\/blog\/why-an-implementation-guide-is-essential\/\">implementation effort<\/a> and ensures a consistent data basis in both systems. The script shown provides the technical foundation to leverage the advantages of both tools on a common data platform.  <\/p>\n  <\/div>\n<\/div><div id=\"teaser-slim-block_81f502d4fd6b74856f09630a0ff41a5d\" class=\"teaser-slim block block--teaser-slim\" data-title=\"\">\n  <div class=\"teaser-slim__content content\">\n    <div class=\"content__img\">\n              <img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"549\" src=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-1024x549.png\" class=\"attachment-large size-large\" alt=\"\" srcset=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-1024x549.png 1024w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-300x161.png 300w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-768x412.png 768w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-1536x824.png 1536w, https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed-2048x1098.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\">          <\/div>\n    <div class=\"content__info info\">\n              <svg class=\"info__decoration\" width=\"267\" height=\"127\" viewbox=\"0 0 267 127\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n          <path d=\"M151.031 29C218.027 29 272.138 83.0603 272.138 149.5C272.138 215.94 218.027 270 151.031 270C84.0352 270 29.9248 215.94 29.9248 149.5C29.9248 83.0603 84.0352 29 151.031 29Z\" stroke=\"#FBC105\" stroke-width=\"58\"><\/path>\n        <\/svg>\n                    <div class=\"info__sl\">Are you considering using privacy-first tracking? Matomo could be the right choice, especially if GA4 tracking with a GTM Datalayer is already in place.  <\/div>\n            <h2 class=\"info__hl\">We are happy to support you with all tracking topics<\/h2>      <a href=\"https:\/\/e-dialog.group\/en\/contact-form\/\" target=\"_self\" class=\"info__cta\">\n        Contact us!\n      <\/a>    <\/div>\n  <\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google&#8217;s technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.      <\/p>\n","protected":false},"author":3,"featured_media":14725,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[445],"channel":[],"goal":[463],"technology":[36,38],"c-year":[432],"class_list":["post-14724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","goal-digital-strategy","technology-google-analytics","technology-google-tag-manager","c-year-432"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way! - e-dialog<\/title>\n<meta name=\"description\" content=\"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google&#039;s technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!\" \/>\n<meta property=\"og:description\" content=\"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google&#039;s technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/\" \/>\n<meta property=\"og:site_name\" content=\"e-dialog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/edialog.group\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-19T13:06:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-27T15:34:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1373\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Carmen Contreras-Salazar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Carmen Contreras-Salazar\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/\"},\"author\":{\"name\":\"Carmen Contreras-Salazar\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#\\\/schema\\\/person\\\/1927cb9ff601113fff87d7570a6cd6ce\"},\"headline\":\"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!\",\"datePublished\":\"2026-01-19T13:06:15+00:00\",\"dateModified\":\"2026-02-27T15:34:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/\"},\"wordCount\":10,\"publisher\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/GTM-GA4-Matomo_processed.png\",\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/\",\"url\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/\",\"name\":\"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way! - e-dialog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/GTM-GA4-Matomo_processed.png\",\"datePublished\":\"2026-01-19T13:06:15+00:00\",\"dateModified\":\"2026-02-27T15:34:24+00:00\",\"description\":\"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google's technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#primaryimage\",\"url\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/GTM-GA4-Matomo_processed.png\",\"contentUrl\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2026\\\/01\\\/GTM-GA4-Matomo_processed.png\",\"width\":2560,\"height\":1373},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/\",\"name\":\"e-dialog\",\"description\":\"Data-driven Marketing &amp; Strategie\",\"publisher\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#organization\",\"name\":\"e-dialog\",\"url\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/e-dialog-logo.svg\",\"contentUrl\":\"https:\\\/\\\/e-dialog.group\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/e-dialog-logo.svg\",\"width\":1,\"height\":1,\"caption\":\"e-dialog\"},\"image\":{\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/edialog.group\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/e-dialog-gmbh\\\/\",\"https:\\\/\\\/www.instagram.com\\\/e_dialog\\\/\",\"https:\\\/\\\/www.tiktok.com\\\/@e_dialog\"],\"description\":\"Bei e-dialog gestalteten wir gemeinsam die Zukunft des data-driven Marketings - mit einem gro\u00dfartigen Team aus passionierten Expert*innen.\",\"email\":\"kontakt@e-dialog.group\",\"telephone\":\"+43 1 309 09 09\",\"legalName\":\"e-dialog GmbH\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/#\\\/schema\\\/person\\\/1927cb9ff601113fff87d7570a6cd6ce\",\"name\":\"Carmen Contreras-Salazar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g\",\"caption\":\"Carmen Contreras-Salazar\"},\"url\":\"https:\\\/\\\/e-dialog.group\\\/en\\\/blog\\\/author\\\/carmen\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way! - e-dialog","description":"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google's technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/","og_locale":"en_US","og_type":"article","og_title":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!","og_description":"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google's technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.","og_url":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/","og_site_name":"e-dialog","article_publisher":"https:\/\/www.facebook.com\/edialog.group","article_published_time":"2026-01-19T13:06:15+00:00","article_modified_time":"2026-02-27T15:34:24+00:00","og_image":[{"width":2560,"height":1373,"url":"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png","type":"image\/png"}],"author":"Carmen Contreras-Salazar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Carmen Contreras-Salazar"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#article","isPartOf":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/"},"author":{"name":"Carmen Contreras-Salazar","@id":"https:\/\/e-dialog.group\/en\/#\/schema\/person\/1927cb9ff601113fff87d7570a6cd6ce"},"headline":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!","datePublished":"2026-01-19T13:06:15+00:00","dateModified":"2026-02-27T15:34:24+00:00","mainEntityOfPage":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/"},"wordCount":10,"publisher":{"@id":"https:\/\/e-dialog.group\/en\/#organization"},"image":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#primaryimage"},"thumbnailUrl":"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png","articleSection":["Analytics"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/","url":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/","name":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way! - e-dialog","isPartOf":{"@id":"https:\/\/e-dialog.group\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#primaryimage"},"image":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#primaryimage"},"thumbnailUrl":"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png","datePublished":"2026-01-19T13:06:15+00:00","dateModified":"2026-02-27T15:34:24+00:00","description":"Privacy-first tracking is also possible with an existing GA4 &amp; GTM infrastructure. Matomo is perfectly suited to integrate with Google's technical system. Matomo does not require its own or a new Datalayer for this. A simple script automatically synchronizes the existing GTM dataLayer from GA4 with the Matomo dataLayer _mtm. This script intercepts push events from the GTM Datalayer and forwards them to Matomo. Subsequently, triggers and variables can be set up in Matomo Tag Manager to utilize precisely this data. This method saves time, avoids redundancy, and ensures consistent data in both analytics tools.","breadcrumb":{"@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#primaryimage","url":"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png","contentUrl":"https:\/\/e-dialog.group\/wp-content\/uploads\/2026\/01\/GTM-GA4-Matomo_processed.png","width":2560,"height":1373},{"@type":"BreadcrumbList","@id":"https:\/\/e-dialog.group\/en\/blog\/gtm-ga4-datalayer-in-matomo-tracking-the-easy-way\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/e-dialog.group\/en\/"},{"@type":"ListItem","position":2,"name":"GTM &amp; GA4 Datalayer in Matomo Tracking: The Easy Way!"}]},{"@type":"WebSite","@id":"https:\/\/e-dialog.group\/en\/#website","url":"https:\/\/e-dialog.group\/en\/","name":"e-dialog","description":"Data-driven Marketing &amp; Strategie","publisher":{"@id":"https:\/\/e-dialog.group\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/e-dialog.group\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/e-dialog.group\/en\/#organization","name":"e-dialog","url":"https:\/\/e-dialog.group\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/e-dialog.group\/en\/#\/schema\/logo\/image\/","url":"https:\/\/e-dialog.group\/wp-content\/uploads\/2025\/06\/e-dialog-logo.svg","contentUrl":"https:\/\/e-dialog.group\/wp-content\/uploads\/2025\/06\/e-dialog-logo.svg","width":1,"height":1,"caption":"e-dialog"},"image":{"@id":"https:\/\/e-dialog.group\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/edialog.group","https:\/\/www.linkedin.com\/company\/e-dialog-gmbh\/","https:\/\/www.instagram.com\/e_dialog\/","https:\/\/www.tiktok.com\/@e_dialog"],"description":"Bei e-dialog gestalteten wir gemeinsam die Zukunft des data-driven Marketings - mit einem gro\u00dfartigen Team aus passionierten Expert*innen.","email":"kontakt@e-dialog.group","telephone":"+43 1 309 09 09","legalName":"e-dialog GmbH"},{"@type":"Person","@id":"https:\/\/e-dialog.group\/en\/#\/schema\/person\/1927cb9ff601113fff87d7570a6cd6ce","name":"Carmen Contreras-Salazar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ecaa86dda30fdb1e64885c879d9ba3430e57bc844ebfd4a66191cefe68d54cdb?s=96&d=mm&r=g","caption":"Carmen Contreras-Salazar"},"url":"https:\/\/e-dialog.group\/en\/blog\/author\/carmen\/"}]}},"_links":{"self":[{"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/posts\/14724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/comments?post=14724"}],"version-history":[{"count":1,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/posts\/14724\/revisions"}],"predecessor-version":[{"id":14730,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/posts\/14724\/revisions\/14730"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/media\/14725"}],"wp:attachment":[{"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/media?parent=14724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/categories?post=14724"},{"taxonomy":"channel","embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/channel?post=14724"},{"taxonomy":"goal","embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/goal?post=14724"},{"taxonomy":"technology","embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/technology?post=14724"},{"taxonomy":"c-year","embeddable":true,"href":"https:\/\/e-dialog.group\/en\/wp-json\/wp\/v2\/c-year?post=14724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}