New format
Goals in Yandex Metrica: types and setup
Goals in Metrica show whether visitors reach the actions that matter: thank-you page, “Buy” click, form submit, session depth. Without goals, ads and SEO reports stay vanity visit counts.
Below: goal types, when to pick which, how to set a URL condition and an event via `reachGoal`, how to build a multi-step funnel, and how to verify firing. Counter install is a separate piece; account UI changes — lean on the meaning of Goals / conditions.
What goal types exist
The base set: pageview count (session depth), page visit (URL condition), JavaScript event (click/submit/custom), multi-step goal (chain of steps). Pick the type for the action that actually means business.
First state the site goal: lead, purchase, call, signup. Then translate it into a measurable Metrica condition. Configure before scaling ads — otherwise you optimize blind.
Four practical types:
- pageviews — engagement
- URL — thank-you, cart, contacts
- JS event — buttons and forms
- multi-step — funnel stages
“Pageview count” goal
Counts sessions where the person opened at least N pages. Useful on media, learning series, and brand blogs: is navigation clear, does content stick.
For pure ecommerce it’s a weak money KPI. Use it as an extra quality signal — not the store’s main conversion.
When it fits:
- content portal
- course of article series
- B2B warm-up blog
- checking “do they read past the homepage”
“Page visit” goal
Fires when the visit URL matches a condition: exact match, “starts with,” “contains,” or a regular expression. Classics — `/thanks/`, `/cart/`, `/order/success/`, shipping page.
You see whether people reach the key URL, whether internal links work, and conversion of paths to checkout. For groups of cards, “starts with” / “contains” help — but don’t make the condition too broad or you get noise.
URL conditions:
- equals — one exact address
- starts with — catalog/checkout branch
- contains — shared fragment in pretty URLs
- regexp — complex masks (watch for mistakes)
URL goal examples
| Job | Condition | Example |
|---|---|---|
| Thank-you | equals / contains | /order/success/ |
| Cart | contains | /cart |
| Category | starts with | /catalog/pumps/ |
| Contacts | equals | /contacts/ |
JavaScript event and reachGoal
You need an event when the URL doesn’t change: “Buy” click, form submit, popup open, “show phone.” In the account create a JavaScript goal and set an identifier (Latin letters, digits, `_`).
On the site call goal completion. Current call: `ym(12345678, 'reachGoal', 'ORDER_CLICK');` — plug in your counter ID and identifier. For forms, fire on successful submit/callback — not on every field focus.
Typical events:
- CTA click “Order” / “Add to cart”
- successful form submit
- chat start / phone reveal
- configuration pick
- share (if it matters for KPIs)
Multi-step goal and funnel
A multi-step goal is a chain of steps (URL and/or events). It shows where people drop: catalog → product → cart → checkout. Steps must be required and in a logical order.
Mind session timeout: a long idle can break the chain. Don’t assemble ten micro-steps “just in case” — keep stages you actually decide on.
Sample ecommerce funnel:
- category view
- product card
- cart
- checkout start
- successful order (URL or event)
Verification and common failures
After saving wait a couple of minutes, turn off “Don’t count my visits” for the test, walk the scenario yourself, and check the goals report. For events open the console: any JS errors, does `ym` fire.
If there’s no data — also see “Metrica isn’t working”: blockers, cache, counter missing on some templates, wrong ID. Online chats and widgets send their own events — match current names in the widget docs; don’t copy outdated lists blindly.
Verification checklist:
- goal saved in the account
- URL condition matches the live address
- reachGoal with the right id and counter number
- test visit not filtered out
- no console errors on click/submit
FAQ
Should I set up the counter first or goals?
A working counter on all templates first, then goals. Otherwise you’re configuring into the void.
When is a “page visit” goal better than an event?
A URL goal is simpler: no code on the button. An event is more precise for clicks, forms, and steps without a URL change.
Which reachGoal code is current?
Modern form: `ym(XXXXXX,'reachGoal','TARGET_NAME')`, where XXXXXX is the counter ID. Legacy `yaCounter….reachGoal` still appears — better migrate to `ym`.
How many steps belong in a multi-step goal?
As many meaningful funnel stages as you need (often 2–5). Don’t split every click — you get noise and broken sessions.
Why isn’t my goal counting?
Wrong URL condition, event not firing, “Don’t count my visits,” blocker, goal not saved, cached old JS.
Do I need goals for Yandex Direct?
Yes if you optimize and judge campaigns by conversions. Linking counter and ad account follows current Yandex rules.
Do goals replace the ecommerce report?
No. Ecommerce/purchases are a separate data track. Goals are universal conversions and micro-conversions.
Can a store use “pageview count” as a goal?
As soft interest — yes. For money, cart, checkout, and leads matter more. Don’t confuse engagement with revenue.
Ads and SEO report visits — but no goal for thank-you, form, or Buy click?
We’ll set URL goals, reachGoal events, and a clean funnel — then verify firing before scaling.
Discuss the task