Aller au contenu
wheremyflow
Fonctionnalités Tarifs Comparatif Manifeste Aide Audit Contact Démo Connexion

Downloads

wheremyflow captures clicks on file links automatically — no need to instrument every <a>. The data appears under Content → Downloads.

Extensions tracked by default

.pdf, .zip, .rar, .7z, .tar, .gz, .csv, .xls, .xlsx, .doc, .docx, .ppt, .pptx, .mp3, .mp4, .mov, .dmg, .exe, .apk, .iso.

How it works

On every click on an <a href> whose extension matches, the snippet emits a file_download event with the properties:

  • file_path — the file path (without the domain).
  • file_name — the bare filename.
  • file_ext — the extension (without the dot).
  • link_text — the link text (max 200 chars).

Disable

If you don't want a particular download tracked (e.g. on a heavy doc page where the same file is linked several times), add data-wmf-ignore to the link:

<a href="/specs.pdf" data-wmf-ignore>specs.pdf</a>

Extend

For non-standard extensions, fire the event manually:

document.querySelectorAll('a[href$=".gltf"]').forEach((a) => {
  a.addEventListener('click', () => {
    window.wmf('event', 'file_download', {
      file_path: new URL(a.href, location.href).pathname,
      file_ext: 'gltf',
    });
  });
});