Salesforce Visualforce Pages Metrics

Salesforce Visualforce Pages Metrics

Using VisualforceAccessMetrics object/entity in a Salesforce SOQL Query, we can track the number of views for each and every Visualforce page in our org receives in a 24-hour time period. To find out how many views a page got over the course of multiple days, you can query multiple VisualforceAccessMetrics objects for the same ApexPageId.

SOQL:

SELECT ApexPageId, ApexPage.Name, DailyPageViewCount, 
Id, ProfileId, MetricsDate, LogDate 
FROM VisualforceAccessMetrics 
ORDER BY ApexPage.Name

Output:

LogDate provides the date that the page access was logged.
ProfileId is the ID of the profile associated with the users who accessed the page.
ApexPageId is the ID of the tracked Visualforce page.
DailyPageView tracks the daily page view count in the DailyPageViewCount field.
MetricsDate is the date the metrics were collected is specified in MetricsDate.

Note:
Page views are tallied the day after the page is viewed, and each VisualforceAccessMetrics object is removed after 90 days.

Leave a Reply