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 paste the standard Matomo JavaScript Tracking code in the Tag Configuration HTML field.
    Finally you need to define a trigger on Pageview to trigger this custom HTML Tag and record your users pageviews.
  5. Click “Triggers” and then “New”.
  6. 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.