# Outbound links and downloads

The script counts clicks on links to other sites, and on links to files, with nothing to set up.

A link to a shop, a partner or a download can be the point of a page. The Links panes show which links are followed and which files are taken, narrowed by the dashboard’s filters, such as to visits from Google. On a page where you’d rather not count them, one attribute turns them off.

## Outbound clicks

A click on a link to any host other than the page’s own, counted under where the link goes: its host, without `www.`, and its path. The query string and anything after `#` are left off. A subdomain is another host, so a link from `example.com` to `shop.example.com` is outbound. The host with `www.` and without it are one site, so a link between `www.example.com` and `example.com` isn’t.

## Downloads

A click on a link to a file on the page’s own host, with or without `www.`, counted under the file’s path. A link is to a file when its path ends in one of 390 extensions, in any case, such as `.pdf`, `.zip`, `.docx`, `.xlsx`, `.csv`, `.mp3`, `.mp4`, `.dmg` and `.exe`. Images, scripts and stylesheets count too, so a link to `/photos/cat.jpg` is a download. Page types such as `.html`, `.php` and `.aspx` never are.

A link to a file on another host is an outbound click, not a download. [Download extensions](https://fiveb.ar/docs/outbound-and-downloads/download-extensions.md) lists all 390, and the page types that never count.

## What counts as a click

- A click with the main button, or with a key held to open the link elsewhere.
- A middle click, which opens the link in a new tab.
- Enter pressed on a link, which browsers treat as a click.

A right click doesn’t count, since it only opens a menu, and nor does a link opened from that menu. Only `http:` and `https:` links count, so `mailto:` and `tel:` links don’t. Links added by a script count like any other, and so does a click your own code stops. Links inside a web component count as well, unless its shadow root is closed.

A file fetched without a link, such as one a script downloads, or a form sent to another site, isn’t counted. Send a [custom event](https://fiveb.ar/docs/events.md) for those.

## On the dashboard

Outbound clicks and file downloads are panes under Links, counted in clicks. Hover over a row for an arrow that opens the link or the file in a new tab.

A click counts with the visit it was made in, on the page it was made on. So filtered by Google, the panes show the clicks in visits from Google, and filtered by a page, the clicks made on it. They aren’t available filtered by an entry or exit page, or by a goal. See [Filters](https://fiveb.ar/docs/filters.md).

## Turning them off

If a page’s links lead somewhere you’d rather not follow, such as an app’s links to its customers’ own sites, stop counting both with [`data-links="off"`](https://fiveb.ar/docs/script-attributes.md#data-links) on its tag. A link with `data-tally` still sends its event.
