The standard Metrika snippet runs on page load and immediately writes the _ym_uid identifier — before any consent. The fix: move the ym(…, "init", …) call out of global code and into the consent banner's accept callback. For visitors who reject the banner the counter never initialises. No data is lost for the "before consent" period — Metrika simply starts the session at initialisation time.
Free online tool — compliance checker: instant results, no signup.
The snippet from the Metrika dashboard sits in <head> and executes before the page renders: the _ym_uid and _ym_d cookies are written and the first request to mc.yandex.ru leaves before the visitor has seen the banner. That is precisely what any privacy audit records: an identifier shared before consent.
The universal pattern — wrap initialisation in a function and call it from your CMP's consent handler (Cookiebot, CookieYes, a home-grown banner — makes no difference):
function initMetrika() {\n if (window._metrikaInited) return;\n window._metrikaInited = true;\n (function(m,e,t,r,i,k,a){ /* standard tag.js loader */ })\n (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");\n ym(XXXXXX, "init", { clickmap:true, trackLinks:true, accurateTrackBounce:true });\n}\n\n// call from your banner:\nconsentBanner.on("accept", initMetrika);\n\n// returning visitor who already consented:\nif (getCookie("analytics_consent") === "1") initMetrika();The key details: a double-init guard; a repeat call on every page for visitors with stored consent; and no call at all when the visitor pressed Reject.
If tags are managed through Google Tag Manager, Consent Mode achieves the same: the Metrika tag fires on a consent event (a trigger on the custom consent_analytics_granted event your banner pushes to the dataLayer). Same logic — the tag does not fire until consent exists.
Open the site in incognito: before pressing Accept there must be no _ym_uid in Application → Cookies and no requests to mc.yandex.ru in Network. After Accept, both appear. The compliance scanner checks exactly this automatically across several pages and shows the before/after consent contrast in its report.
Regulators fine sites for processing personal data without consent — and a site starts processing earlier than it seems: analytics, pixels and widgets write cookies the moment the page loads. The scanner shows the auditor's view: what leaves for third parties before consent, whether the banner works, and whether forms collect data correctly.
Three sessions per page: no action, banner accepted, banner rejected.
Service catalogue: who receives visitor data and in which country.
The policy link and consent element are checked next to the form, not in the footer.
Report with an HMAC integrity stamp — hand it to your lawyer or contractor.
preparing for an audit
technical facts for an opinion
client site handover
consent regression monitoring
Scheduled re-checks with an alert when pre-consent trackers appear on your site.
Sign up freePartially: visits from people who reject the banner will not reach Metrika. That is what consent means. Rejection rates are usually 5–15% — the rest of your statistics remain intact.
Every ym(…, "reachGoal", …) call must check whether the counter is initialised. A simple queue works well: buffer events in an array before init and replay them after.
Yes. One rule for every counter and pixel: initialise only from the accept callback. Each of them writes its own visitor identifier.
Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.