Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy between getCustomDimension and action report segmented by custom dimension #15173

Closed
mfb opened this issue Nov 20, 2019 · 4 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@mfb
Copy link

mfb commented Nov 20, 2019

I noticed a discrepancy between the nb_pageviews reported by Actions.get segmented by a custom dimension, e.g. ?module=API&method=Actions.get&idSite=1&format=json&period=day&date=2019-11-18&segment=dimension3==99095

and the nb_hits reported for that custom dimension by CustomDimensions.getCustomDimension, e.g. ?module=API&method=CustomDimensions.getCustomDimension&idSite=1&format=json&period=day&date=2019-11-18&idDimension=3

The nb_pageviews and 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 mfb changed the title custom dimension Discrepancy between getCustomDimension and action report segmented by custom dimension Nov 20, 2019
@tsteur
Copy link
Member

tsteur commented Nov 20, 2019

@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?

@mfb
Copy link
Author

mfb commented Nov 20, 2019

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 "nb_pageviews":4877

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 "nb_hits":1198

@tsteur
Copy link
Member

tsteur commented Nov 20, 2019

Actually, this is expected I reckon because of #11900

module=API&method=Actions.get&idSite=1&format=json&period=day&date=2019-11-18&segment=dimension3==99095

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: #15137 (comment)

@tsteur tsteur closed this as completed Nov 20, 2019
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Nov 20, 2019
@mfb
Copy link
Author

mfb commented Nov 21, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

2 participants