June 20, 2019

How to access Metrics for Your Visualforce Pages in Salesforce?

Using VisualforceAccessMetrics, you can track the number of views each Visualforce page in your 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. This parameter is available for release 216 and later.
ProfileId is the ID of the profile associated with the users who accessed the page. This parameter is available for release 216 and later.
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.

No comments:

Post a Comment