Use multiple container feature to extend base tracking?

Matomo supports multiple containers, as stated in the documentation (

Our use case is as follows:

  • We have one container which contains a basic version of our tracking code
  • We want to extend this code on a site-by-site basis (e.g. customer-specific customizations)

My idea is to include the basic container on all sites and to create customer-specific containers for the customizations.

The appropriate extended container would also be loaded.

However, there seems to be no control over the order of loading of the containers. And as the code in the extended container depends on objects defined in the first, the entire construct only works by chance, depending on the loading order.

Is the idea not possible? Or should it be possible?

Many thanks in advance for any help.

p.s. the documentation is somewhat unclear, as multiple containers are discussed but then states “To use both tags, simply copy both embed codes inside your website, ideally one directly followed by the other.”. But tags are not analogous to containers.