---
updatedAt: 2026-08-31T05:54:25.000Z
agentTools:
  projectIndex: https://developers.piwik.pro/llms.txt
---

# addDownloadExtensions

The **addDownloadExtensions()** adds a file extension to the existing list of file extensions that should be tracked as downloads. Downloads are clicks on links to downloadable files.

## Syntax

```js JavaScript
addDownloadExtensions(extensions)
```
```js Angular
addDownloadExtensions(extensions): void
```
```js Gatsby
addDownloadExtensions(extensions): void
```
```js Next.js
addDownloadExtensions(extensions): void
```
```js Nuxt
addDownloadExtensions(extensions): void
```
```js React
addDownloadExtensions(extensions): void
```
```js VUE
addDownloadExtensions(extensions): void
```

## Parameters

| Parameter  | Type                     | Description                                                                                                                                    | Required |
| :--------- | :----------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------- | :------- |
| extensions | string \| array\<string> | The list of file extensions to be tracked as downloads. Can be written as string (Example: "zip\|rar") or an array (Example: \["zip", "rar"]). | Yes      |

## Examples

To add a `mhj|docx` extensions to the existing list of file extensions:

```js JavaScript
_paq.push(["addDownloadExtensions", "mhj|docx"]);
```
```js Angular
addDownloadExtensions(["mhj", "docx"])
```
```js Gatsby
addDownloadExtensions(["mhj", "docx"])
```
```js Next.js
addDownloadExtensions(["mhj", "docx"])
```
```js Nuxt
addDownloadExtensions(["mhj", "docx"])
```
```js React
addDownloadExtensions(["mhj", "docx"])
```
```js VUE
addDownloadExtensions(["mhj", "docx"])
```

## Notes

* The list of file extensions is not persisted in a visitor’s browser. You need to call it on each page load.
* We check for extensions at the end of the URL path and in query parameter values. Here are a few examples of how we detect the extension:
  * `http://example.com/path/file.zip`
  * `http://example.com/path/file.zip#hello`
  * `http://example.com/path/file.zip?a=102`
  * `http://example.com/path/?a=file.zip`
  * `http://example.com/path/?a=file.zip&b=29`
* Here’s the default list of file extensions tracked as downloads: 7z, aac, apk, arc, arj, asf, asx, avi, azw3, bin, csv, deb, dmg, doc, docx, epub, exe, flv, gif, gz, gzip, hqx, ibooks, jar, jpg, jpeg, js, mobi, mp2, mp3, mp4, mpg, mpeg, mov, movie, msi, msp, odb, odf, odg, ods, odt, ogg, ogv, pdf, phps, png, ppt, pptx, qt, qtm, ra, ram, rar, rpm, sea, sit, tar, tbz, tbz2, bz, bz2, tgz, torrent, txt, wav, wma, wmv, wpd, xls, xlsx, xml, z, zip.

## Related methods

* [trackLink()](https://developers.piwik.pro/docs/tracklink)
* [enableLinkTracking()](https://developers.piwik.pro/docs/enablelinktracking)
* [disableLinkTracking()](https://developers.piwik.pro/docs/disablelinktracking)
* [setIgnoreClasses()](https://developers.piwik.pro/docs/setignoreclasses)
* [setLinkClasses()](https://developers.piwik.pro/docs/setlinkclasses)
* [setDownloadClasses()](https://developers.piwik.pro/docs/setdownloadclasses)
* [setDownloadExtensions()](https://developers.piwik.pro/docs/setdownloadextensions)
* [removeDownloadExtensions()](https://developers.piwik.pro/docs/removedownloadextensions)
* [getDownloadExtensions()](https://developers.piwik.pro/docs/getdownloadextensions)