In Summer'17, Salesforce introduced "VisualforceAccessMetrics" object which can be used information about daily page view count of VF page.
You can query on this object using SOQL. Initially they provided below columns in this object:
You can query on this object using SOQL. Initially they provided below columns in this object:
- ApexPageId - VF page Id
- DailyPageViewCount - Page view count on specific date
- MetricsDate - captures the date on which daily page view count is calculated
In winter'19 release, Salesforce has introduced additional columns which is mentioned below:
- ProfileId - Id of User profile who is accessing the VF page
- LogDate - Specifies most recent page access date
Below are few sample queries which you run in developer console to find VF pages metrics
- SELECT ApexPageId,DailyPageViewCount,Id,MetricsDate,profileId,logdate FROM VisualforceAccessMetrics order by MetricsDate DESC
- SELECT ApexPageId,count(DailyPageViewCount) FROM VisualforceAccessMetrics group by ApexPageId
Query output:
SELECT ApexPageId,ApexPage.Name, DailyPageViewCount,MetricsDate,ProfileId, Profile.name,LogDate FROM VisualforceAccessMetrics order by MetricsDate DESC
Notes:
- This object helps in identifying the page view count of VF in 24 hour time period.
- This object helps in identifying the VF page which needs to be checked for lightning compatibility based on its usage.
- This will also helps to identify which VF pages can be migrated to lightning.
- You can identify which all VF pages are not at all used in organization and can be helpful in metadata clean up.
- This object contain information about VF page usage for last 90 days only.
Hope this will help!!