Online store parameters

Yandex.Metrica lets you make a detailed report on orders completed on the store's website.

To set up a report:

Step 1. Creating the “Order confirmation” goal

  1. In the Yandex.Metrica service, go to the counter editing page.
  2. In the Goals section, create a Page URL or Event type of goal.

|||UNTRANSLATED_CONTENT_START|||Параметры при достижении этих целей должны передаваться либо на целевые страницы, либо при вызове функции reachGoal.|||UNTRANSLATED_CONTENT_END|||

Depending on the type of goal, choose one of the ways to edit the counter code.

Step 2. Editing counter code

  1. Set up transmission of session parameters — add the following lines to the counter code:

    <script type="text/javascript">
    var yaParams = {/*Session parameters*/};

    Also add the parameter for passing order information to the counter code, params:window.yaParams||{ }:

    (function (d, w, c) {
     (w[c] = w[c] || []).push(function() {
    try { var yaCounterXXXXXX = new Ya.Metrika({id: XXXXXX, params:window.yaParams||{ }}); }
    catch(e) { }
  2. Install the resulting code on the target page (for example, on the order confirmation page). You can leave the normal counter code on the rest of the pages.

Step 3. Passing order parameters to the yaParams variable

On goal pages on the site, you must pass order information to the yaParams variable. To set up data transmission, contact your webmaster or other specialist responsible for site administration. Data is formatted according to the JSON standard.

Example of the format for transmitting data:

var yaParams = {
  order_id: "12345",
  order_price: 123.45, 
  currency: "RUB",
  exchange_rate: 1,
          id: "1", 
          name: "item name", 
          price: 100,
          quantity: 1







string or number

Order ID.



Amount of the order as shown to the user in the currency in currency.



Order currency (acceptable values: RUR, RUB, UAH, BYN, USD, EUR, TRY, KZT, GBR, CNY, MDL, LVL, TMT, CAD, THB, AUD). By default, the national currency that is determined based on the store's region.




The exchange rate for currency, if the store uses its own exchange rate.

If a different currency is shown when making the order, in order to convert it to a supported currency, indicate both currency (the currency to convert to) and exchange_rate (the exchange rate).



Array of products.

string or number

ID of a product in the store.

string or number

Name of the product.

We recommend transmitting this parameter to the report. This makes it easier to navigate the list of products. If you pass the name parameter, you don’t need to pass id.




Price of the product in the currency specified in currency.




Quantity of products.

You can use different parameters to share other values. They will be processed in the same way as the parameters in the Session parameters report. However, for other parameters, you must use a separate variable different from yaParams.