# Download tracking

> Which files people download, recorded from the link click with no code: the extensions recognised, the download attribute and how to exclude a link.

Section: Tracking script  
Canonical page: https://statsy.co/docs/tracking-script/downloads  
Last updated: 2026-09-22

A click on a link to a file is a `download` event with the URL, the file name and its extension. Top files are under **Goals › Captured automatically**, and `name is download` filters any report to the visits that downloaded something.

## What counts as a download

A link whose path ends in one of these extensions:

```text
Documents   pdf doc docx xls xlsx ppt pptx csv txt epub ics json xml sql
Archives    zip rar 7z tar gz tgz iso
Installers  exe msi dmg pkg apk deb rpm
Media       mp3 wav mp4 mov avi mkv
Design      psd ai sketch fig svg ttf woff woff2
```

Or any link with a `download` attribute, whatever the URL looks like. Then the attribute's value is the file name, which is how a link such as `/export?report=42` is reported as `q3-report.csv`.

```html
<a href="/export?report=42" download="q3-report.csv">Download report</a>
```

## Properties

| Property | Example |
| --- | --- |
| url | https://yoursite.com/files/Q3%20report.xlsx |
| file | Q3 report.xlsx |
| ext | xlsx |

## Excluding a link, or all of them

```html
<a href="/terms.pdf" data-statsy-ignore>Terms</a>

<script defer data-website-id="ws_XXXXXXXX" data-track-downloads="false" src="https://statsy.co/js/script.js"></script>
```

## How it is sent

The event leaves with `sendBeacon` in the click's capture phase, before the browser follows the link, so it is delivered even when the download navigates away. Files fetched by JavaScript and saved from a blob are not links, so record those with `statsy.goal('download', …)` where you trigger them.

> **Note.** A download to another domain is also an `outbound` click. Both are recorded, and both count as an event, so a site whose files sit on a CDN domain uses two events per download. Set `data-domain` to your CDN too, or switch off outbound tracking, if that matters.

## Frequently asked questions

### Can I see the file size or whether the download finished?

No. The browser tells a page nothing about a navigation download once it starts, so only the click is knowable.

### Can a download be a goal with a value?

Yes. Create a goal named download on the Goals page and give it a default value, and each download counts that value.

Previous: [Site search](https://statsy.co/docs/tracking-script/site-search)  
Next: [Visitor identification](https://statsy.co/docs/tracking-script/visitor-identification)