Multiple PiwikPro sites under a single container

That resource should be also useful, because there are 2 possible approaches. Best practice one vs multiple tracking codes - #3 by Jarek

Since you cannot fire multiple containers on the same page, my recommendation here would be to add additional properties and install additional custom tags for them within the main container. The trigger would limit the tag to fire only on specific pages. Here’s an example code:

<script type="text/javascript">
    var _ppas = _ppas || [];
    _ppas.push(["trackPageView"]);
    _ppas.push(["enableLinkTracking"]);
    (function() {
        var u = "https://example.piwik.pro/";
        _ppas.push(["setTrackerUrl", u + "ppms.php"]);
        _ppas.push(["setSiteId", "XXX-XXX-XXX-XXX-XXX"]);
        var d = document,
            g = d.createElement("script"),
            s = d.getElementsByTagName("script")[0];
        g.type = "text/javascript";
        g.async = true;
        g.defer = true;
        g.src = u + "ppas.js";
        s.parentNode.insertBefore(g, s);
    })();
</script>

Notes:

  • you replace example.piwik.pro with your domain name
  • you replace XXX-XXX-XXX-XXX-XXX with the proper site id
  • we use _ppas namespace to not interfere with the default tracking for you main site (which uses the _paq namespace

Of course, that’s just one of possible solutions. Keep in mind that if you go with this one, any additional tracking (such as custom events, scroll events, etc.) has to be set up via custom code for those additional properties. All built-in features should work well for the main website.