'Adjusting GTM Javascript Code to fit Matomo

Recently I've set GA4 and GAU tags for tracking Contact form 7 submission on a web site. I used most of the steps from this tutorial.

Now I need to create similar code snippet for Matomo analytics and here is where problem starts. I cannot use Matomo Tag Manager, it must be set in GTM.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source