When you click on a content element in Salesforce, the Downloads tab shows who downloaded the content. Standard Salesforce reports do not provide this download history. To report on download activity, use the Salesforce API to query the ContentVersionHistory object.
Download history is stored in the ContentVersionHistory table. To retrieve download records, query this table using a filter on the field column equal to contentVersionDownloaded. The ContentVersionHistory.CreatedById field identifies who downloaded the file, and ContentVersionHistory.CreatedDate records when the download occurred.
To get the count of downloads per user for today, query ContentVersionHistory filtering by Field = 'contentVersionDownloaded' and CreatedDate = TODAY, grouping results by CreatedById. This returns one row per user with a count of their downloads.
SELECT count(id) DownloadCountByUser, CreatedById FROM ContentVersionHistory WHERE CreatedDate = TODAY AND Field = 'contentVersionDownloaded' GROUP BY createdbyid
For content delivery download tracking (external sharing), query the ContentDistributionView object. Filter by today's date to retrieve content delivery events. This table includes the distribution ID, the creation date, whether the event was a download, whether it was an internal access, and a parent view ID.
Select DistributionId, CreatedDate, IsDownload, IsInternal, ParentviewID From ContentDistributionView where CreatedDate is Today
The ContentVersionHistory table can grow very large in active orgs, and unoptimized queries may be slow. To improve performance, always include a restrictive WHERE clause. The most effective approach is to filter by CreatedDate using an indexed date field, such as CreatedDate = TODAY or a specific date range. Avoid broad queries without date filters on this table.
000385125

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.