Sum of two mutually exclusive custom dimensions do not equal total number of visitors

Hello!

Our goal is to have separate views, preferably using segments, for visits from regular browsers and visits from our app. The app is basically a shell around the website, but can be separated out since it is using a custom UserAgent string.

The best method I’ve found so far is as follows:

  • Create a custom dimension Platform that will separate the different visit origins
  • Create two triggers that filter on the UserAgent string, one that contains the custom string, one that not contains the custom string.
  • Create two Pageview tags that receive a trigger each and set Platform to either Browser or App, both then use the default Matomo Configuration for the site

As far as I can tell, these two paths should register all visits and bin them into the custom dimension. When summing data from the dimension it should match the total number viewed elsewhere.

But we are seeing a significantly lower figure for the individual segment bins, example:

Under Visitors → Platform (the custom dimension):
App - Unique visitors: 98
Browser - Unique visitors: 4134

Under Visitors → Visitors overview:
Unique visitors: 5788

How can this be? All visits should come into the platform using one of these two mutually exclusive paths. Also, the higher figure matches the expectations given the history before implementing this method. It looks like not all visits are registering with the custom dimension rather than visits registering multiple times for the total.

Best regards
Alexander