params

Tip. Working with the JavaScript API requires knowledge of HTML and JavaScript. If you don't know these languages, contact your website developer or webmaster.

Transmits custom session parameters.

Attention. Some field names are reserved for transmitting e-commerce data. Don't use these names to send session parameters. Don't send custom parameters with reserved ones.
ym(XXXXXX, 'params', parameters);

Parameter

Default value

Type

Description

parameters *

Object | Array

Session parameters. Example of sending an object:

var myParams = {test: {myParam: 123}};
ym(XXXXXX, 'params', {params: myParams});

Example of sending an array:

var myParamsArray = [{test: {myParam: 123}},
{test: {myParam: 456}}];
ym(XXXXXX, 'params', {params: myParamsArray});
parameters object fields:
order_price

Double

Goal cost. You can set the cost in currency or Yandex units

currency

string

Use this field if you want to pass the goal cost in currency. Yandex.Metrica recognizes three-letter ISO 4217 currency codes

If a different currency is passed, null values will be sent instead of currencies and amounts

* Required parameter.

Goal cost

In addition to custom session parameters, you can transmit the goal cost in the method parameters. Read more about goal cost

Example:

var visitParams =
{
   test: {myParam: 123}
};
var goalParams =
{
   order_price: 1000.35,
   currency: "RUB"
};
ym(XXXXXX, 'params', visitParams, goalParams)