I noticed a discrepancy between the
nb_pageviews reported by
Actions.get segmented by a custom dimension, e.g.
nb_hits reported for that custom dimension by
nb_hits numbers are always different, but it seems like they should be the same - although I must be missing something? I wonder which numbers are correct?
@mfb not sure I fully understand. They may not be the same for example if other actions such as downloads or outlinks or so have the same custom dimension maybe? I suppose we're talking here of custom dimensions in scope "action" and not "visit"? How much different are the numbers?
Yes, I'm talking about a custom dimension in scope "action".
Usually the numbers are pretty close, but sometimes they are off by a factor of 4.
As an example, if I get the numbers for a specific custom dimension segment,
?module=API&method=Actions.get&idSite=1&format=json&period=week&date=2019-11-17&segment=dimension3==101882 I get
If I get the list of custom dimensions,
?module=API&method=CustomDimensions.getCustomDimension&idSite=1&format=json&period=week&date=2019-11-17&idDimension=3 the row for 101882 has
Actually, this is expected I reckon because of #11900
The segment dimension3 would include all pageviews of all visits that have had viewed a page during with the given custom dimension value during that visit. Before Matomo 3.11.0 the number would have likely been the same but this was actually due to a bug.
here's how to workaronud if needed: https://github.com/matomo-org/matomo/issues/15137#issuecomment-552571872
I see. Well, for future reference, we definitely want to track individual actions w/ custom dimensions and variables. The fact that this count extends to other actions in the same visit is not how we want the action scope to function.