Greetings, I’ve a question regarding setting up two or more “measurables” for a single website. Namely - is it possible?
If anyone else has faced this / similar issue, we’d love to know how you resolved it
Some context below:
We utilize Matomo Analytics in our website, and wish to analyze both internal and external traffic flowing through the site within the Matomo-dashboard. Note that we do not wish to filter out internal traffic, only separate it for more granular analysis.
Initially we thought this could be achieved via Segmentation, by utilizing “visitor IP” as an identifier. It seems however that this utilizes stored IP-information, and our Matomo has IP-anonymization enabled, so we couldn’t use Segmentation-feature to reliably separate internal traffic.
This lead us to creating a new measurable within Matomo, with a separate tracking ID. This new measurable also includes our internal IP within its “excluded IPs”, with the idea being that it would only display external traffic. Not ideal, but good enough for our purposes.
It’s at this point we noticed issues. Our installation method was admittedly crude - we basically installed two tracking IDs within our site via our tag manager, so it ended up looking like this:
Tag 1:
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
Tag 2:
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.org/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '2']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
After installing this and monitoring the real-time visits log, we quickly noticed that the visits for our original measurable visits stopped trickling in, and trickled into the newly established measurable instead. It seemed as if the original measurable stopped working, so we quickly revert our Matomo installation to its previous state, with only the original measurable tracking ID present. Reverting the change fixed the issue, and data was flowing back to the original measurable.
We’re still wondering if there is a functional way of installing multiple measurable / tracking ID’s within a single website. We tried the usual searching / googling around, but didn’t find any results that corrolated to our issue at hand. Hence this thread