logo
search
SharePoint Document Issues

How to Track SharePoint Online File Access Using Audit Logs

Maira MehtabMaira Mehtab Oct 21, 2026 868 views

Question details

The user needs to track who accesses individual documents or videos in SharePoint Online, including identifying the users and viewing access timestamps.

How to Track SharePoint Online File Access Using Audit Logs
Product
SharePoint Online
Device & OS
not provided
Scenario
Monitoring user access and file interaction metrics for specific files hosted in a SharePoint library.
Observed behavior
SharePoint Online does not natively support direct tracking of individual files via Google Analytics, requiring alternative methods like Microsoft Purview audit logs or intermediate landing pages.
Before you start

Ensure you have the necessary administrator permissions in the Microsoft Purview compliance portal to access and run audit log searches for your organization.

Solution 1Recommended

Use Microsoft Purview Audit Logs

This is the recommended and most efficient native method to track file access securely across your entire SharePoint environment.

Microsoft Purview automatically records file activity in SharePoint. Instead of modifying individual files, administrators can query these logs to see exactly who accessed a document and when.

1
Access Microsoft Purview

Log in to the Microsoft Purview compliance portal using your administrator credentials.

2
Navigate to Audit Search

On the left navigation pane, select 'Audit' to open the audit log search tool.

3
Configure Search Parameters

Set the Date and time range. Under 'Activities', select file and page activities such as 'Accessed file' or 'Downloaded file'. Enter the specific SharePoint site or file URL in the 'File, folder, or site' field.

4
Run and Export the Report

Click 'Search' to generate the log. Once the search completes, click 'Export' to download the results as a CSV file for detailed analysis.

Use Microsoft Purview Audit Logs
Data Analysis: Exporting the audit logs to a CSV format allows you to easily filter, sort, and analyze access patterns using spreadsheet tools like Excel, WPS Spreadsheet, or Power BI.
Free Microsoft Office alternative

Analyze Your SharePoint Audit Logs with WPS Office

After exporting your SharePoint file access data, use WPS Spreadsheet to filter, analyze, and visualize your audit logs. WPS Office is a free, lightweight suite that offers comprehensive tools for handling large CSV exports and creating complex data reports seamlessly.

  1. 1. Download and Install: Get WPS Office for free from the official website and install it on your device.
  2. 2. Open Your Exported Data: Launch WPS Spreadsheet and open the CSV audit log file you exported from Microsoft Purview.
  3. 3. Analyze the Data: Use Data Filters or insert a PivotTable to quickly sort users, access times, and specific file interactions.
Free and lightweight alternative to Microsoft OfficeFully compatible with Microsoft Excel (.xlsx) and CSV formatsAdvanced data analysis tools like PivotTables for tracking user access patternsFamiliar user interface that requires no learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Can I directly add Google Analytics to a SharePoint document?

No, SharePoint Online does not allow the direct embedding of Google Analytics code into individual documents or files. You must use intermediate landing pages or rely on native Microsoft Purview audit logs.

What information is captured in a SharePoint audit log?

Audit logs capture comprehensive details including the user who accessed the file, the specific file name and path, the exact timestamp of access, and the user's IP address.

How far back can I track file access in Microsoft Purview?

By default, Microsoft Purview retains audit log records for 180 days for users with standard licenses. Organizations with advanced Microsoft 365 compliance licenses may extend this retention period up to one year or more.

How can I analyze the exported audit logs?

Once exported as a CSV file, you can open the data in spreadsheet software like WPS Spreadsheet or Microsoft Excel to filter the data, create PivotTables, or connect it to Power BI for advanced dashboard visualizations.