← All articles

How to Check Yandex Metrica Goals Before Launching Ads

Test one form from the visitor's action through a saved lead to a Metrica event. A click, a submission attempt and an accepted enquiry are different outcomes. The primary goal should represent what you want advertising to produce.

Two submission attempts sit beside a blue button; one record is clipped into a ledger and linked to a single green counting peg

A goal can fire correctly while measuring a button press rather than a lead. Someone clicks Submit, receives a required-field error and leaves; the report already contains a conversion. Before advertising, test the meaning of the event alongside its delivery path.

Consider a hypothetical service enquiry form. The outcome is a lead saved by the application and available to the responsible staff member. Lead quality and a sale are checked later. Evaluating Direct performance through Metrica becomes useful once this initial measurement is understood.

Define the action that counts as an outcome

Write the rule: one accepted enquiry from this form creates one record and one saved-lead signal. A technical event might use the identifier lead_saved. Keep phone clicks, messenger clicks and form starts separate: they explain the visitor journey but do not establish an accepted enquiry.

The application should confirm storage rather than merely sending an email or staff notification. If the record is saved but notification temporarily fails, investigate notification delivery. If no record exists, an on-screen success message and an HTTP 200 response alone do not establish a lead.

Record the form address, correct tag ID, goal name and type, and event identifier or URL condition. The human-readable name and the identifier sent from code serve different roles. If enquiries belong in customer operations, agree where the working lead history is stored.

Check the goal according to its type

A JavaScript event after confirmed storage

Metrica documentation describes sending a website event with reachGoal. Match the tag ID and event identifier to the goal settings. Use an unambiguous condition for one form so a similar event from another button does not enter the same result.

Place the call in the confirmed server-success handler. A generic click or submit handler runs before you know whether the enquiry was saved. Yandex's archived form-event walkthrough, in Russian explains the difference between clicks and submissions. Our saved-enquiry goal needs the next check: confirmation from the application.

The following developer fragment assumes an illustrative API contract: ok: true means a saved lead and leadId is its stable string identifier. Call it after checking the server response, using the ID of an already installed tag. Adapt field names to your application; the lead identifier stays local and is not sent to Metrica.

const reportedLeadIds = new Set();
function reportSavedLead(result, counterId) {
    if (result.ok !== true ||
        typeof result.leadId !== 'string' || !result.leadId ||
        reportedLeadIds.has(result.leadId) ||
        typeof window.ym !== 'function') {
        return;
    }
    try {
        window.ym(counterId, 'reachGoal', 'lead_saved');
        reportedLeadIds.add(result.leadId);
    } catch (error) {
        return;
    }
}

The fragment prevents another call for the same record on the current page and keeps an analytics error from turning an accepted form into a failure. It does not guarantee Metrica receipt or prevent the server from creating two leads. Reloading clears the identifier set: the application still needs duplicate-save protection and reconciliation of unknown outcomes.

A URL goal on the confirmation page

A page-view goal checks an address, not a database record. Follow the actual post-save transition and compare the condition with its real address: domain, path, trailing slash and parameters. An overly short Contains condition may match other pages.

Then open the confirmation page directly, refresh it and revisit it through history. If another view counts as a lead without a new save, the goal measures a thank-you-page visit. Counting accepted enquiries requires a changed website flow or an explicit saved-lead event. Renaming the goal does not change its meaning.

A ready-made form-submission goal

Yandex documents HTML and standard submit-event requirements for the form-submission goal. It also warns that unsuccessful attempts, such as validation failures, can count by default. Run a negative scenario before describing this goal as a saved lead.

Check the specific form, including mobile and modal versions where present. An automatic goal measuring submission attempts can remain a diagnostic signal. The primary accepted-enquiry goal needs the application's confirmed result.

Run successful, failed and repeated actions

Use test data and an agreed verification method without real customer contacts. Record the application's result and calls to the chosen event for every scenario. This table concerns explicit lead_saved: it describes expected website behavior to verify separately in Metrica.

Acceptance checks for the hypothetical saved-lead form event
ScenarioLead recordslead_saved callsWhat to check
Open the form without submitting00A view or form start does not trigger the saved-lead event
Submit with a required-field error00Validation shows an error; the primary goal is not completed
Receive a server rejection without storage00The response and message do not disguise rejection as success
Save a lead successfully11The signal follows confirmation of that record
Process the same lead response again1 total1 total on the pageSeveral handlers do not report the same response repeatedly
Lose the response after a possible saveState needs reconciliation0 until confirmedEstablish the result first; a retry does not create a duplicate
Open or refresh the thank-you pageNo new recordsNo new callsA URL goal may count the view; it is not a new lead
Create two distinct valid enquiries22Duplicate protection does not suppress a separate new record
Save while analytics is unavailable1May be 0 or undeliveredThe form remains successful; signal loss is recorded separately
Submit on mobile or with Enter11The event does not depend only on clicking one button

A double click needs two checks: the application should not create an extra record, and analytics should not report the same record again. If two requests receive different identifiers, the example's local guard does not merge them. Repair server-side lead acceptance and form behavior.

Check whether code, a tag manager and a third-party widget all send the same event. Metrica's goal-frequency limit does not replace this investigation: documentation specifies no more than once per second for the same goal. Inspect website calls separately from reported goal completions and goal-reaching sessions.

Reconcile the website signal with the debugger and report

The official goal check uses _ym_debug=2. Add it to the address with ?, or & when parameters already exist, load the page and perform the action. Select the correct tag in the panel; check the JavaScript event identifier in Events and Console.

An enabled “Don't count my sessions” filter can affect testing; Yandex suggests a private browser window. The debug panel requires the new tag code; documentation describes the console and _ym_debug=1 for older code. A missing panel does not establish that the lead was not saved.

Compare three pieces of evidence: the application record, event transmission and the reported completion after processing. Without a record, investigate the form and server. With a record but no call, inspect the success handler and analytics availability. With a visible call but an empty report, check the tag ID, goal condition, filters and delivery. Browser restrictions or analytics that has not been permitted to run can leave a saved lead without a signal; do not bypass them to force matching totals.

Repeat a normal submission after repair and record the test date, page, selected goal and actual result. Repeat negative scenarios when the form, widget or success handler changes. Choose a verified outcome for the advertising strategy and evaluate diagnostic clicks separately.

Separate goal configuration from website repairs

The free Yandex Metrica Advisor helps inspect tags, permissions, goals and data and explain what needs attention. For a new or revised goal, it supports a guarded plan to create or update one JavaScript or URL goal. Applying it requires separate exact confirmation, followed by an independent readback from Metrica.

Changing a goal condition does not move a call from a click handler into a saved-result handler. That is website code work, accepted using the scenario table. The advisor also does not upload CRM, calls or offline conversions; estimate those integrations separately. A goal correction does not recalculate historical data already collected.

If the form itself loses enquiries or shows false success, start with the visitor-to-lead journey and required application changes. Measurement readiness means understanding the counted action, confirming storage and knowing where its signal can be lost.

Practical decision checklist

  1. Define one saved-enquiry result and its tag and goal identifiers.
  2. Check JavaScript, URL or form-submission conditions against actual behavior.
  3. Test success, validation failure, repeated responses and lost delivery.
  4. Compare saved records, event transmission and processed reports after repair.

Sources and methodology

The following references support the facts and technical details in this article:

Check what your goal measures

The free advisor helps review Metrica and prepare a controlled correction of one supported goal.

Check measurement with the free advisor