Metrica

clickmap

Attention! 

Outdated method. Supported for backward compatibility, but may be deprecated at any time. We strongly discourage its use.

To manage collection of click data, use the clickmap parameter during counter initialization.

Managing collection of information for generating click maps.

clickmap(properties)

Parameter

Default value

Type

Description

properties *
[no-highlight[

* Required parameter.

]no-highlight]

Boolean | Object

By default, information is collected about all clicks on the page.

You can disable click tracking by sending the false value to the parameter.

yaCounterXXXXXX.clickmap(false);

Click tracking parameters (the Object type) are remembered. So if click tracking was disabled, when clickmap(true) is called, click collection is performed according to the previously set parameters.

Fields of the properties object
properties.filter

Function

Click filtration for specific DOM elements.

properties.ignoreTags

String[]

A list of HTML tags to not track clicks for

properties.quota

Number

Maximum number of tracked clicks on a page

* Required parameter.

Example

var yaCounterXXXXXX = new Ya.Metrika({id: XXXXXX});
yaCounterXXXXXX.clickmap({
    mode: 'default',
    quota: 1,
    delay: 10,
    ingoreTags: ['input', 'textarea'],
    filter: function(domElement) {
        if (
               domElement.className == 'menu-item'
               ||
               domElement.id == 'footer'
           ) {
            return false; // Ignoring the click
        }
        return true;
    }
});

You can also disable click tracking using the ym-disable-clickmap class.