You can use Matomo with Google Tag Manager.

To setup Matomo Tracking in Google Tag Manager, follow these steps:

  1. Go to Google Tag Manager
  2. Click “Tags” and then “New”.
  3. Click “Tag Configuration” and select “Custom HTML”
  4. Copy the standard Matomo JavaScript Tracking code:
    • log in to Matomo with your admin or Super User account
    • click on the “administration” (cog icon) in the top right menu
    • click on Tracking Code in the left menu (under the “Measurables” or “websites” menu)
    • click on Tracking Code in the left menu
    • click on “JavaScript Tracking” section
    • select the website you want to track
    • copy the tracking code
  5. Paste this JavaScript tracking code in the Tag Configuration HTML field.
  6. Finally you need to define a trigger on Pageview to trigger this custom HTML Tag and record your users pageviews:
    • Click “Triggers” and then “New”.
    • Click “Trigger Configuration” and choose “Pageview”. This will fire the Matomo Analytics tracking code when the web browser begins to load a page.
  7. Then Publish the current container’s workspace to make these changes live in your website.
  8. Open your website in the browser and perform some actions (eg: navigate to different pages)
  9. Login to your Matomo instance to check if you’re getting the tracking data of your site

To learn even more about using Matomo with GTM, we recommend this 3rd party article: Google Tag Manager and Matomo.

Did you know? Matomo also has its own Tag Manager, learn more about the Matomo Tag Manager.