---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/support/metrica/en/pro/methods.md
  - https://yandex.com/support/metrica/es/pro/methods.md
  - https://yandex.com/support/metrica/pt/pro/methods.md
  - https://yandex.com/support/metrica/ru/pro/methods.md
  - https://yandex.com/support/metrica/tr/pro/methods.md
  - https://yandex.com/support/metrica/zh/pro/methods.md
  - href: en/pro/methods.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: Transmitting data on additional events
description: "To send additional event data to Yandex\_Metrica, you can use standard JavaScript methods. We recommend using distinct methods for transmitting different types of data."
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/en/llms.txt


# Transmitting data on additional events

To send additional event data to Yandex Metrica, you can use standard JavaScript methods. We recommend using distinct methods for transmitting different types of data.

## Data transmission limits {#limits}

- Maximum number of nested levels: 10.
- Maximum size per JSON: 8 KB.
- Maximum number of parameters per session: 512.

[Data transfer restrictions](https://yandex.com/support/metrica/en/general/limits.md)

## Sending pageview data {#views}

We recommend using these methods to send pageview data:

- `init`: When initializing the tag.
- `hit`: For transmitting large amounts of data and for AJAX or Flash websites.

**init method**

 
:   {% note info %}
    
    Use the `init` method for small amounts of data and the [hit](../objects/hit.md) method for large ones.
    
    {% endnote %}
    
    
    The `init` method is typically used for normal tag initialization on the website and is specified by default in the code snippet:
    
    ```javascript translate=no
    ym(XXXXXXXX, "init", {});
    ```
    
    Sample tag code with additional parameters:
    
    ```javascript translate=no
    ym(XXXXXXXX, "init", {
        clickmap: true,
        trackLinks: true,
        accurateTrackBounce: true,
        webvisor: true,
        ecommerce: "dataLayer",
        params: {
            user_info: {
                user_id: "123456",
                user_type: "customer"
            }
        }
    });
    ```
    
    
    {% note alert %}
    
    Use caution when introducing additional parameters into the `init` method. If errors occur during data transmission, the pageview may not be recorded for the user, and any subsequent actions on this page may not be included in the session.
    
    {% endnote %}
    
    
    [init method](../code/counter-initialize.md)

**hit method**

 
:   Use this method to send large amounts of data. The `hit` method is also suitable for AJAX or Flash websites, where the user navigates between pages within the same window, without loading any new pages.
    
    ```javascript translate=no
    ym(XXXXXXXX, 'hit', url[, options])
    ```
    
    Here’s an example of using the method with additional data:
    
    ```javascript translate=no
     ym(XXXXXXXX, 'hit', '#contacts', {
        params: {
            page_info: {
                title: "Page title",
                referrer: "Page referrer"
            },
            user_info: {
                user_id: "123456",
                user_type: "customer"
            }
        }
    }); 
    ```
    
    [hit method](../objects/hit.md)

## Sending data on goals and events {#goals-events}

To send data about user events and actions on your site, we recommend these methods:

- `reachGoal`: For sending goal data.
- `params`: For sending data about additional events you want to analyze.

**reachGoal method**

 
:   Use this method for events that you plan to set as goals in Yandex Direct or for viewing data about goal completion in Yandex Metrica.
    
    ```javascript translate=no
    ym(XXXXXXXX, 'reachGoal', target[, params[, callback[, ctx]]]);
    ```
    
    Example of using the method with additional parameters:
    
    ```javascript translate=no
    ym(XXXXXXXX,'reachGoal','TARGET_NAME', {
        page_info: {
            title: "Page title",
            referrer: "Page referrer"
        },
        user_info: {
            user_id: "123456",
            user_type: "customer"
        },
        action_info: {
            action_type: "select",
            action_placement: "action_placement"
        }
    }); 
    ```
    
    [reachGoal method](../objects/reachgoal.md)

**params method**

 
:   Use this method for the events you wish to analyze without setting them as goals:
    
    ```javascript translate=no
    ym(XXXXXXXX, 'params', parameters);
    ```
    
    Example of using the method with parameters:
    
    ```javascript translate=no
    ym(XXXXXXXX, 'params', {
        action_info: {
            action_type: "select",
            action_placement: "action_placement"
        }
    });
    ```
    
    [params method](../objects/params-method.md)

<!-- source: en/_includes/buttons/chat-button.md -->
[Chat with us](https://yandex.com/chat/#/user/036e6a02-3620-9cdc-4c5e-a34667a7379e?utm_source=spravka){.button}

<!-- source: en/_includes/styles/href-to-button.md -->

<!-- endsource: en/_includes/styles/href-to-button.md -->
<!-- endsource: en/_includes/buttons/chat-button.md -->

<!-- source: en/_includes/footer-links.md -->
- - -

<div class="borderless-table">

#|
||
Useful links

- [Demo tag](https://metrica.yandex.com/r/dashboard?)
- [Add a tag](https://metrica.yandex.com/add/)
- [Free tag setup](https://yandex.com/promo/freeservice/metrica?utm_source=help_metrica_en&utm_medium=cpc&utm_campaign=1)
- [Yandex Metrica API](https://tech.yandex.com/metrika/)
- [Suggest your idea](https://yandex.com/support/metrica/troubleshooting/idea.html)
- [Discuss in Telegram](https://t.me/yandexmetrika)
|
Online training

- [Get a Yandex Metrica certificate](https://yandex.ru/adv/expert/exam/metrika/?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)


- [Take a training course](https://yandex.com/adv/edu/online/metrika?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)

||
|#

</div>

<!-- source: en/_includes/styles/table-style.md -->

<!-- endsource: en/_includes/styles/table-style.md -->
<!-- endsource: en/_includes/footer-links.md -->
