Answer the question
In order to leave comments, you need to log in
How to provide banner cutters when working with Yandex.Metrica from a JS application?
There is a web application, a one-pager on Backbone, modules are loaded via RequireJS. Among other things, Yandex.Metrica and the VKontakte advertising network are loaded.
Many visitors have AdBlock or other extensions that block advertising and tracking scripts - Metrika (metrika / watch) and VK (vkpreroll, vkadman).
There are many places in the code where there are calls to the Metrica to collect statistics - event markings, for example App.Metrika.params({ auth_recheck: 1})
, in case the Metrica is not loaded, an alternative is written in the RequireJS config - a local stub module, an object with Metrica methods, only there are empty functions:
return {
addFileExtension: function(){}
, clickmap: function(){}
// и т.д.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question