---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
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
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/support/metrica/zh/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.

For more information, see [Restrictions](https://yandex.com/support/metrica/zh/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 %}
    
    
    More details about the [init](../code/counter-initialize.md) method.

**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"
            }
        }
    }); 
    ```
    
    More details about the [hit](../objects/hit.md) method.

## 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"
        }
    }); 
    ```
    
    More details about the [reachGoal](../objects/reachgoal.md) method.

**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"
        }
    });
    ```
    
    More details about the [params](../objects/params-method.md) method.

<!-- source: zh/_includes/buttons/chat-button.md -->
[与我们聊天](https://yandex.com/chat/#/user/036e6a02-3620-9cdc-4c5e-a34667a7379e?utm_source=spravka){.button}

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

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

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

<div class="borderless-table">

#|
||
实用链接

- [演示计数器](https://metrica.yandex.com/r/dashboard?)
- [添加计数器](https://metrica.yandex.com/add/)
- [免费计数器设置](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/)
- [提出您的想法](https://yandex.com/support/metrica/troubleshooting/idea.html)
|
线上培训



- [参加培训课程](https://yandex.com/adv/edu/online/metrika?utm_source=metrika_help&utm_medium=web&utm_campaign=static&utm_content=useful_links)

||
|#

</div>

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

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