Filtering Analytics Cloud Individual User Activity by Date Range via API
written-by
Rishabh Agrawal
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
legacy-article
learn-legacy-article-disclaimer-text
Issue
- There is a requirement to filter Analytics Cloud individual user activity data by date range using the API.
- individual user activity can be extracted with
curl -i -L -H "Authorization: Bearer {token}" -L https://analytics.liferay.com/api/reports/individuals/{individualsId}/activities, but it's not filtered by date.
- The
fromDate and toDate parameters work for exporting all user data (curl -i -L -H "Authorization: Bearer [token]" https://analytics.liferay.com/api/reports/export/[type]?fromDate=[ISO 8601 date and time]&toDate=[ISO 8601 date and time]), but not when requesting specific individual data.
Resolution
- Currently, there is no way to filter individual user activity by date range directly through the API. The
fromDate and toDate parameters are only available for data export requests, which extract all activities within the specified time frame, not filtered by individual.
- Users can filter by
channelId (for activities within a specific property) and page (for pagination) using this format: https://analytics.liferay.com/api/reports/individuals/{individualsId}/activities{?channelId,page}. The available parameters for a data query request can be found in the _links field of API responses.
- As a workaround, users can filter individual activity by date range through the Analytics Cloud dashboard:
- Go to Individuals > Known Individuals.
- Select the desired user.
- Use the date dropdown to choose Custom Range and set the dates.
- Click Download Reports.
- Moreover, a feature request for the desired functionality is created and tracked as LPD-55417.
did-this-article-resolve-your-issue