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

"period=range" parameter #803

Open
JLuc opened this issue Nov 24, 2024 · 2 comments · May be fixed by #804
Open

"period=range" parameter #803

JLuc opened this issue Nov 24, 2024 · 2 comments · May be fixed by #804

Comments

@JLuc
Copy link

JLuc commented Nov 24, 2024

https://developer.matomo.org/api-reference/reporting-api documents 'period' and 'date' API argument :

  • for period=range it states an example: « to request a report for the range Jan 1st to Feb 15th you would write period=range&date=2011-01-01,2011-02-15 »
  • date documentation includes this :
Note: if you set 'period=range' to request data for a custom date range, 
the API will return the sum of data for the specified date range. 
When 'period=range', the following keywords are supported for the parameter 'date':
- lastX
- previousX
- YYYY-MM-DD,YYYY-MM-DD, both dates can be replaced with magic keywords 
(the first one does not support today and yesterday). 
eg. YYYY-MM-DD,today, lastMonth,YYYY-MM-DD or lastYear,lastWeek

But when date is last10, is it 10 days ? weeks ? months ? years ?

Documentation should mention what parameter holds 'day', 'week', 'month' or 'year' when period is range.

It could be date=last10 is not possible when period=range, and in such a case documentation should be fixed also.

@9joshua
Copy link

9joshua commented Nov 26, 2024

Thank you for taking the time to create this issue @JLuc .The documentation does need clarification.

When using period=range together with date=lastX Matomo uses a unit of Day by default.
This means that lastX can only be used for a range of Days.

Otherwise lastX can be used for intervals specified in the period value.
For example, period=month&date=last12 would produce a report with metrics for each month of the last 12 months...
image

JLuc added a commit to JLuc/developer-documentation that referenced this issue Nov 26, 2024
Documentation should mention what parameter holds 'day', 'week', 'month' or 'year' when period is range.
fixes matomo-org#803
@JLuc JLuc linked a pull request Nov 26, 2024 that will close this issue
11 tasks
@JLuc
Copy link
Author

JLuc commented Nov 26, 2024

thanks
please merge or improve #804

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

Successfully merging a pull request may close this issue.

3 participants