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
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
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 ?