Laptop screen showing files and documents ready to download

File Download Tracking: How to Measure PDF, ZIP, and Document Downloads

You publish a whitepaper, a price list, a media kit, or a software installer, and you link to it from a landing page. The landing page shows up in your analytics with hundreds of views. But how many people actually downloaded the file? Standard analytics can't tell you — because downloading a file isn't a pageview. File download tracking closes that gap.

Why Downloads Don't Show Up in Pageviews

Analytics records a pageview when an HTML page loads and runs the tracking script. A PDF, ZIP, DOCX, or installer is not an HTML page — it's a binary file that the browser either downloads or hands off to a viewer. No tracking script runs, so nothing is recorded. As far as a basic setup is concerned, the download never happened.

This is a real measurement gap for any site that distributes files: a SaaS company offering an installer, a consultancy with gated PDFs, a media brand with downloadable reports, or a store with spec sheets. The download is often the single most important action on the page, and it's invisible by default.

How File Download Tracking Works

Instead of waiting for the file to load (it never will, as a page), download tracking listens for the click on the link that points to a file. When a visitor clicks a link ending in .pdf, .zip, .docx, or another tracked extension, the tracker fires an event recording the file path before the download begins.

Because the page itself stays put during a download, there's no race against the browser unloading — the click event fires cleanly. This is closely related to custom event tracking; a download is essentially a special, automatically detected event.

The detection pattern

// A tracker watches for clicks on links that point to files const FILE_RE = /\.(pdf|zip|docx?|xlsx?|pptx?|csv|dmg|exe|mp3|mp4)$/i; document.addEventListener('click', e => { const a = e.target.closest('a'); if (!a || !FILE_RE.test(a.pathname)) return; track('download', { file: a.pathname }); });
statpx does this automatically. The standard tracking snippet recognizes links to common file types and records them as download events — no manual tagging, no onclick attributes on every link.

Reading Your Download Data

The core report is a ranked list of files and how many times each was downloaded, ideally with the page the download was triggered from:

FileDownloads (30d)Top source page
/files/2026-pricing.pdf942/pricing
/downloads/app-setup.exe610/download
/files/media-kit.zip187/press
/files/whitepaper-q2.pdf96/resources

Combine downloads with the source page's pageviews to get a download conversion rate. If /pricing had 4,000 views and the price list was downloaded 942 times, that's a 23.5% download rate — a strong signal the asset is wanted and well-placed. A 1% rate on a page built around a download suggests the link is buried, mislabeled, or broken.

How to Use Download Data

statpx captures file downloads out of the box

PDFs, ZIPs, installers, spreadsheets — clicks on file links are recorded automatically by the standard snippet. See which assets people actually download and from where.

Start tracking free →

The Bottom Line

If your site distributes anything downloadable, the download is the conversion — and a pageview report can't see it. File download tracking turns "200 people visited the resources page" into "200 people visited and 47 downloaded the report," which is the number that actually tells you whether the page works. Track downloads alongside content performance so every asset you publish earns its place by the actions it drives, not just the traffic it attracts.

Continue reading

Technical
How to Identify and Block Referrer Spam in Website Analytics
Technical
How to Filter Your Own Visits Out of Website Analytics
Technical
Custom Dimensions in Analytics: Track Extra Context Beyond Pageviews
Analytics by statpx