We have currently an international website(SPA site) where we have implemented a Piwik Pro Container(with tracking code) according to this guide with help of GTM. This container is implemented for a specific locale of the site for testing before launching on the whole site, e.g www.example.com/de.
Good to know, it’s a website built on reactJS.
Because visitors can navigate to this locale from other parts/locales on the site without the page reloading we have decided to trigger the tag in GTM with the container code for every page view(SPA).
This setup creates an error that we noticed in the console when the container tries to initialize a second container on the visitor’s second page view and so on, see the image below:
The idea for this international website is to later on set up containers for a Meta Site and multiple Sites for all the different locales and have the container code on the site instead of pushing it with help of GTM.
TLTR/My Question: What is the best way/best practice to structure containers for international websites and to avoid container loading errors?