The first thing you need to do is give a clear (to avoid confusion) name for the target and identifier.
Order button
Please note: the ID must not even partially slovenia telemarketing database match the URL of any page on the site. Its name must also not contain Cyrillic characters or the symbols /, &, #, ?, or =.
Step 2: You need to add the ID name to the HTML code. This can be done using the onclick and onsubmit attributes.
To do this, you need to find the code for the button or form whose interaction you want to track (these are the most popular JavaScript events). Then, you need to enter the following code:
To click a button: reachGoal(knopka); return true;”
Replace NNNNNNNN with the counter number. You can find it in the Yandex.Metrica settings. Knopka is the identifier name we specified when adding the goal.
Once you make the changes, your button code will look like this:
onclick=”yaCounter12345678.reachGoal('knopka'); return true;”>…</…>,
where 123456 is the counter number and 'knopka' is the identifier.
This is what the “link click” goal looks like:
<a href=”…” onclick=”yaCounter12345678.reachGoal('knopka'); return true;”>link text</a>.
Goal 4. Compound Goal
Consists of the "Page Visit" and "Javascript Event" conditions. It can contain up to five steps. The goal is counted if all steps are completed in the specified sequence. However, the user may be distracted by other pages and actions.
A composite goal helps trace a visitor's journey from the product page to the final purchase. This is called a sales funnel. Analyzing it helps you understand at what stage the buyer is encountering difficulties and why.
How to set up

Let's consider a composite goal using the example of an online store with a large number of products.
The first step is to visit the catalog. Since the store has many products, we'll set a common condition for all items: url:contains "catalog."
Next comes the JavaScript event—a click on the "Add to Cart" button. You need to set an ID and then make changes to the code.
After this, the customer should proceed to the cart to checkout. We'll configure this action using the condition url:contains "basket."
Here, the buyer must fill out the order form. We format it the same way as in the previous section, with the condition url:contains "order."
The final step can be implemented via a JavaScript event (a button click) or via url:contains (a transition to the "Thank You" form). The latter is easier. Enter "success" in the field and create a composite goal.