Tag Manager vs. traditional JS snippet vs. a mix of both

Hi!

I have been using Matomo for quite a while with the old/traditional JS code snippet integrated in my Websites (for visitor tracking, campaign tracking and also e-commerce tracking). Everything is fine so far.

I have now had a look at the (relativly) new Tag Manager which seems to have some good advantages but I did not find anything (like a manual or an official documentation) what explains when I should use Tag Manager or normal JS snippet or even both or JS snippet integrated by Tag Manger. Are there any differences, upsides/downsides and how do both relate to each other. Could both methods eventually cause problems if used together?

I understand that Tag Manager is a new development that has been added to Matomo a while ago and now got more and more grown-up but I find it really hard to understand what is the best or even the official way to integrate Matomo into a Website. The existing documentations are either from former times or simply ignore the fact that there are concurrent/competing integration methods.

Is there any plan to provide a document/article to give a better overview to the world on the integration topic?

If I should have missed anything existing out there, I would love to get pointed to that here… Thanks a lot!

Best regards,

Joe

Mainly:
The advantage of Tag Manager is that you can add / remove some tracking (page views, events, etc.) without having to change the code of the site itself. (no need to deploy the site each time you want to add/remove tracking “tags”)
The disadvantage is that if you are not aware of what you’re doing, you can break the (live) website.

Also it is not (easily) possible to do all what you want with just MTM (e.g. add some content tracking attributes to new tracked content). Then some times, people prefer a mix between MTM and standard tracking. Also remember that with MTM you can add JavaScript thanks to the HTML tag (if you use the following code):

<script>
  console.log("hello world");
</script>

Did you have a look at:

:question: