# Tracking Downloads

Tracking downloads of files on a website is essential for many website owners. CountUp will automatically track file downloads on your website by default. This allows you to easily understand which files and file types (extensions) are viewed the most. This is because CountUp will automatically capture the file name and extension for all downloads.

Tracking works for all common file extensions. This includes: pdf, xlsx, docx, txt, rtf, csv, exe, key, pps, ppt, pptx, 7z, pkg, rar, gz, zip, avi, mov, mp4, mpeg, wmv, midi, mp3, wav, wma.

# How it Works

File download tracking works out-of-the-box with no additional configuration. Behind the scenes, CountUp will analyze clicks on anchor <a> elements and see if they refer to a path with a file extension or if they have a download attribute.

# Adding additional Extensions

By default, automatic download tracking works for the extensions listed above. However you can easily add additional file extensions by providing a comma separated list using the data-track-file-extensions attribute of your script tag. For example:

<script
  defer
  data-domain="your-domain.com"
  data-track-file-extensions="js,css"
  src="https://cdn.countup.io/script.min.js"
></script>

In the example above, all links that end on .js or .css would also be tracked as file downloads (in addition to the default ones).

# Disable Automatic Download Tracking

If you don't want file downloads to be tracked automatically, you can disable this feature by setting the data-disable-download-tracking attribute on the tracking snippet:

<script
  defer
  data-domain="your-domain.com"
  data-disable-download-tracking
  src="https://cdn.countup.io/script.min.js"
></script>