extLink
Sends information about clicks on outbound links.
The data collected is used for generating click maps and Outbound links reports.
ym(XXXXXX, 'extLink', url[, options]);
Parameter | Default value | Type | Description |
---|---|---|---|
url * | — | string | The URL of the destination page |
options | — | Object | |
options fields | |||
options.callback | Type: Function | — | The callback function called after sending data about a file download |
options.ctx | — | Object | Context accessed by the |
options.params | — | Object | Session parameters |
options.title | document.title | string | Title of the current page |
params object fields: | |||
order_price | — | Double | Revenue by goal. 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. |
Parameter | Default value | Type | Description |
---|---|---|---|
url * | — | string | The URL of the destination page |
options | — | Object | |
options fields | |||
options.callback | Type: Function | — | The callback function called after sending data about a file download |
options.ctx | — | Object | Context accessed by the |
options.params | — | Object | Session parameters |
options.title | document.title | string | Title of the current page |
params object fields: | |||
order_price | — | Double | Revenue by goal. 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.
Example
ym(XXXXXX, 'init', {});
//...
ym(XXXXXX, 'extLink', 'https://yandex.com');
Revenue by goal
If clicking an external link is one of the goals configured on your website, you can transmit the revenue in the method parameters. Details about revenue by goal
Example:var goalParams =
{
order_price: 1000.35,
currency: "RUB"
};
ym(XXXXXX, 'extLink', 'https://yandex.com', goalParams)