The library provides site statistics counters to use in BEM-based project.
- Yandex-metrica
Google-analytics(in progress)
- Get the library
$ bower install bem-stat-counters --save
- Include the library to levels declaration in your compiler tool config (e.g. enb, bem-tools)
enb example
function getLevels(config) {
return [
// vendors levels
{
path: 'vendors/stat-counters',
check: false
},
// your own levels
].map(function(levelPath) { return config.resolvePath(levelPath); });
}
bem-tools example
// TODO
- Declare any library block in your bemjson
{
block: 'footer',
content: [
// smth content,
{
block: 'yandex-metrica',
params: {
id: configs.metrika.id,
webvisor: true,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true
}
}
]
}
Block has one required param id
and other optional params, see example below
{
block: 'yandex-metrica',
params: {
id: configs.metrika.id, // required param
webvisor: true,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true
}
}