Multiple Containers / Tag Managers on Single Site

Setup

  • My team is building a web component, which is integrated on many host sites
  • Each of these host sites is managed by a different team and has its own Matomo Tag Manager with its own id e.g. <script src="https://.../container_ugas78d7sg.js">
  • We want to only visualise our own events in our Dashboard. We don’t care about the analytics of the host sites and the host sites do not care about ours.
  • My idea was to load a second tag manager script e.g. <script src="https://.../container_asd3s99ssd.js"> and send events using this 2nd container. However both scripts want to load the tag manager in window._mtm .
  • Multiple containers on the same site should to be possible, but there is no example in the documentation

Questions:

  • How to load a second container and sent events to it without overwriting _mtm ?
  • Is there a better alternative without loading a second container?