Metrica

addFileExtension

Tip. Working with the JavaScript API requires knowledge of HTML and JavaScript. If you don't have these skills, contact your website developer or webmaster.

Tracks downloads of files with the specified extensions.

addFileExtension(extensions)

Parameter

Default value

Type

Description

extensions *
[no-highlight[

* Required parameter.

]no-highlight]

String | String[]

The file name extension set as a string, or a list of extensions specified as an array of strings

* Required parameter.

By default, the following extensions are supported:

3gp

crc32

gz

phps

torrent

7z

css

iso

png

ts

aac

csv

jpg, jpe, jpeg

ppt, pptx, pptm, pptb

txt

ac3

cue

js

psd

vob

acs

divx

m3u, m3u8

rar

wav, wave

ai

dmg

m4a, m4v

rtf

webm

avi

djv, djvu

md5

sea

wma, wmv

ape

doc, docx, docm, docb

mkv

sit

wmf

apk

emf

mp3, mp4, mpg, mpeg

sfv

xls, xlsx, xlsm, xlsb

asf

eps

mov

sha1

xpi

bmp

exe

msi

svg

zip

bz2

fla, flac

ods

swf

cab

flv

ogg, ogm, ogv

tar

cdr

gif

pdf

tif, tiff

Example

var yaCounterXXXXXX = new Ya.Metrika({id: XXXXXX});
yaCounterXXXXXX.addFileExtension('lzh'); // Add an extension
yaCounterXXXXXX.addFileExtension(['lha', 'iff', 'ico']); // Add several extensions