How to track file downloads in WordPress Free & Pro

WordPress doesn't count file downloads. Compare GA4 file_download events, host logs and server-side counting, then see who downloaded what, step by step.

Updated September 26, 2026

WordPress does not record file downloads: uploaded files are served straight from the uploads folder, so no WordPress code runs when someone opens one. To track downloads, either measure link clicks with an analytics tool such as GA4, or route downloads through a plugin endpoint that counts each request on your server.

Does WordPress track downloads on its own?

No. The Media Library lists your files, not what happens to them. A download is an ordinary request for a static file, and the web server answers it before WordPress loads.

Where those requests are recorded at all, it is usually in your host’s raw access log. It lists each request with a time, an IP address and a browser string. That is useful for a spot check, but hard to use for reporting: logs mix in bots, cannot say which signed-in user made a request, and many hosts keep them only for a short period.

Option 1: Google Analytics 4 file_download events

GA4’s enhanced measurement can record a file_download event when a visitor clicks a link to a file. If GA4 is already on your site, it is free to use. Know its limits before you report on it:

  • It counts clicks, not completed downloads. The event fires in the browser at the moment of the click.
  • It misses visitors it cannot measure. Ad blockers, browser tracking protection and declined cookie consent all remove visits from GA4, so figures run low.
  • It only sees clicks on your own pages. A file opened from an email, a search result or another website does not load your page, so no event is sent.
  • It recognises files by their extension. Enhanced measurement looks for links ending in a common file extension such as .pdf, .docx or .zip. Links that go through a download script usually do not end that way, so they need the event sent another way.
  • It cannot tell you who. Google Analytics’ terms do not allow personally identifiable information, such as email addresses, to be sent to it. GA4 reports anonymous activity.

GA4 is good for trends: which documents get attention, and from which pages. It is not a record of who received a file.

Option 2: Count downloads on your server

The alternative is to stop linking to the raw file and link to an endpoint that records the request, then serves the file. Because the counting happens on the server, it works whichever page, email or bookmark the link came from, and ad blockers do not affect it. For signed-in visitors, the same endpoint can record who downloaded what, and when.

Download manager and document library plugins work this way.

GA4 file_download Host access logs Server-side counting endpoint
Counts downloads started from emails or other sites No Yes Yes
Affected by ad blockers and consent choices Yes No No
Names the signed-in user No No Yes, if the plugin logs it
Readable per document without extra work Partly No Yes
Setup A GA4 tag Your host’s control panel A plugin

How to track downloads with FileDeck

FileDeck routes document downloads through its own download endpoint, so counting happens on your server. Lifetime counts are free; the per-person log and reports are part of FileDeck Pro.

  1. Count downloads per document.

    Free — add your files as FileDeck documents. Each document’s downloads are counted at FileDeck’s download endpoint and shown in the Downloads column of the Documents list. There is no setting to switch on. Known search-engine crawlers are left out of the count; your own test downloads are included. See download counts.

  2. Show the numbers to visitors.

    Free — add the downloads column to a library, for example [filedeck columns="title,type,downloads,link"], or place the Top Downloads widget in a sidebar. See columns.

  3. Log who, what and when.

    Pro — go to Documents → Settings → Features and enable Log activity — views, searches and downloads (who / when / what). It is off by default. Entries appear under Documents → Insights → Activity log, with totals for the last 7 days, 30 days and all time, a Most accessed table, and Export full log as CSV. Signed-in users are named; entries also carry country, referrer and user agent where your host provides them. See the activity log.

  4. See trends over time.

    Pro — Documents → Insights → Analytics charts downloads over time and lists top documents and top searches over 30, 90 or 365 days or all time, with CSV export. It reads the activity log, so turn logging on first.

  5. Put a name to anonymous downloads.

    Pro — tick Require name & email before download under Documents → Settings → Features. Each lead is stored under Documents → Audience → Leads with the document it unlocked. See lead capture, or require a form before download to use your own form plugin.

  6. Get told when a file is downloaded.

    Pro — under Documents → Settings → Downloads, tick Send a notification for every download to receive an email or a webhook call per download. Emails are capped at 200 a day across the site. See download notifications.

  7. Keep GA4 in the picture.

    Pro — under Documents → Settings → Features, tick Send document events (downloads, searches, previews) to Google Analytics 4. FileDeck then sends the standard file_download, search and select_content events through the GA4 tag already on your site, so its download links show up in your reports. It is off by default, needs Google’s gtag.js GA4 tag on your site already (a Tag Manager-only setup does not provide it), and sends no data to FileDeck.

The activity log stores visitor IP addresses. Under Documents → Settings → Privacy you can mask the last part of each IP before it is stored and purge older rows on a schedule, and a registered user’s activity can be exported or erased from Tools → Export Personal Data / Erase Personal Data. Mention download logging in your privacy policy, as you would any analytics.

Which method should you use?

  • "Which documents are popular?" Free lifetime counts answer this. GA4 adds which pages sent the traffic.
  • "Who has this file?" You need a per-person log, such as FileDeck Pro’s activity log, with visitors signed in.
  • "Who is interested in our whitepaper?" Lead capture turns anonymous downloads into contacts.
  • "Has everyone read the new policy?" A download shows someone received a file, not that they read it. For a dated confirmation from each person, see acknowledgment tracking, which is part of the AI tier.

FAQ

Why don’t my GA4 download numbers match my plugin’s count?

They measure different things. GA4 counts measured clicks on your pages. A server-side counter counts requests that reached the download endpoint, including those from emails and bookmarks, and ad blockers and consent choices do not affect it. The server-side figure is usually the higher one.

Can I see who downloaded a specific PDF?

For signed-in users, yes — FileDeck Pro’s activity log records the user, the document and the time, and exports to CSV. Anonymous visitors appear as counts with an IP address (which you can choose to mask), so use lead capture if you need a name.

Do bots inflate download counts?

FileDeck’s counter leaves out known search-engine crawlers, identified by their user agent. Downloads made with command-line tools such as curl are still counted, because a person ran them.

Is download counting free?

Yes. The lifetime counter per document, the downloads library column and the Top Downloads widget are in the free plugin from wordpress.org. The who-and-when log, analytics dashboard, lead capture, notifications and GA4 events are Pro.

Will downloads from a link in an email be counted?

Yes, when the link is the document’s FileDeck download link, because counting happens at the endpoint. A raw uploads URL skips the counter — Pro’s file protection stops raw URLs working for restricted documents.

Next steps

Try the library on the live demo, then read download counts and the activity log for the detail. If you also want people to see their own history, personal download history adds a [filedeck_my_downloads] list to a portal page. Compare Free and Pro on the pricing page.

Still stuck? Email support@getfiledeck.com.