To use Matomo with Angulartics2, you must first include the standard Matomo tracking script in your index.html head tag.
Important: You must comment out or delete the _paq.push(['trackPageView']); line from the standard snippet. Angulartics2 handles page tracking automatically on route changes, and leaving this line active will result in duplicate page views.
Replace YOUR-DOMAIN in the script with your actual Matomo domain (e.g., //DOMAIN.innocraft.cloud for Innocraft cloud service).
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
// _paq.push(['trackPageView']); // DELETE THIS LINE
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.YOUR-DOMAIN.com/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '11']);
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+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->