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

API pivotBy and pivotByColumn #773

Open
meyerdominik opened this issue Jan 25, 2024 · 6 comments
Open

API pivotBy and pivotByColumn #773

meyerdominik opened this issue Jan 25, 2024 · 6 comments

Comments

@meyerdominik
Copy link

matomo-org/matomo#4776 (comment)

What pivotBy-dimensions are available?
I can't seem to find any documentation about that. Neither is anything working, that I've tried to guess. I'm always getting the error Invalid dimension '<...>'..

Example: I want to pivot the VisitsSummary.getVisits by country.

https://<matomo-url>/?module=API
&method=VisitsSummary.getVisits
&idSite=2
&date=last7
&period=day
&format=xml
&language=de
&token_auth=<api-token>
&filter_limit=-1
&pivotBy=<??>
&pivotByColumn=Country
@michalkleiner
Copy link
Contributor

@meyerdominik
Copy link
Author

Yes, I have. It just says:

[...]To pivot a report, this query parameter must be set to the ID of the dimension to pivot by. For example, queryParam=Referrers.Keyword would pivot against the Keyword dimension.

Sadly my question isn't answered by the docs.

@meyerdominik
Copy link
Author

I finally found them: All available dimensions can be requested with the method CustomReports.getAvailableDimensions

Imho this needs to be described in the Optional API parameters -> pivotBy; section.

@michalkleiner
Copy link
Contributor

It seems like that method possibly comes from a premium plugin that not all users may have available to them, can you confirm that you do use the Custom Reports premium plugin? Does it only apply then?

@meyerdominik
Copy link
Author

Oh yes it is, I wasn't aware of that (I asked a colleague).

@sgiehl
Copy link
Member

sgiehl commented Mar 25, 2024

pivotBy is only supported by custom reports and a couple of reports in core, that have a second dimension, like event reports. So this can't be used for all reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants