### Get and Install Logo Code Source: https://top.mail.ru/help/ru/code/receive This snippet is for the visual logo of the counter, which can display view counts and unique visitors. It can be placed anywhere on your website. If you choose not to display a logo, this code will not be provided. ```html
The logo code can be placed anywhere on your site.
Example placeholder for logo code:
The counter code should be placed inside the <BODY> tag, as early as possible towards its beginning.
Example placeholder for counter code:
``` -------------------------------- ### Install Top.Mail.Ru Informer Script Source: https://top.mail.ru/help/ru/realtime/informer Include this script tag in your HTML to load the Top.Mail.Ru informer functionality. It's recommended to place it where convenient for your site's structure. ```html ``` -------------------------------- ### Informer HTML Structure with Classes Source: https://top.mail.ru/help/ru/realtime/informer Example of the generated HTML structure for the informer widget, showing the default classes used for styling. The 'cid' attribute should contain the counter ID. ```html ``` -------------------------------- ### Placeholder for Informer Widget Source: https://top.mail.ru/help/ru/realtime/informer This div element serves as the container where the informer widget will be rendered. Replace 'ID вашего счетчика' with your actual Top.Mail.Ru counter ID. ```html ``` -------------------------------- ### Customizing Informer Appearance with CSS Source: https://top.mail.ru/help/ru/realtime/informer Demonstrates how to override default styles for the informer widget using CSS. This example changes the text color and font family for titles and removes list styling. ```css ``` -------------------------------- ### onready Callback API Documentation Source: https://top.mail.ru/help/ru/api/jsapi Defines a callback function to be executed once the tracking code is fully loaded and initialized. This ensures that methods are called only after the tracker is ready. ```APIDOC onready(callbackObject) - Registers a callback function to run when the tracker is ready. - Parameters: - callbackObject: An object containing the callback details. - type: string (Required) - Must be 'onready'. - callback: function (Required) - The function to execute after initialization. - context: object (Optional) - The execution context ('this') for the callback function. - Usage: var _tmr = window._tmr || (window._tmr = []); _tmr.push({ type: 'onready', callback: function() { // Your callback code here } }); ``` -------------------------------- ### sendEvent API Documentation Source: https://top.mail.ru/help/ru/api/jsapi Records a custom event with optional category, action, label, and value. The value parameter is summed for unique category+action+label combinations. Categories starting with an underscore are reserved. ```APIDOC sendEvent(eventObject) - Records a custom event. - Parameters: - eventObject: An object containing event details. - id: string (Required) - Your tracking ID. - category: string (Required) - The event category. Reserved categories start with '_'. - action: string (Required) - The event action. - label: string (Optional) - Additional information about the event. - value: number (Optional) - The event value, summed for unique category+action+label combinations. - Usage: _tmr.sendEvent({ id: "YOUR_ID", category: "userflow", action: "readArticle", label: "about" }); _tmr.push({ id: "YOUR_ID", type: "sendEvent", category: "userflow", action: "readArticle", label: "about" }); ``` -------------------------------- ### Configure Host Filters API Source: https://top.mail.ru/help/ru/api/configure API for managing host and network filters. Allows listing, adding, removing, editing, and toggling host filtering status. Requires counter ID and authentication credentials. ```APIDOC API Endpoint: https://top.mail.ru/json/confhosts Description: Manages website host and network filtering settings. This API supports operations like listing, adding, removing, editing, enabling ('on'), or disabling ('off') host filters. Parameters: - id (required, string): The counter ID for the website. - password or session (required, string): Authentication credentials (password or session token). - action (optional, string): The type of operation to perform. Supported values: 'list', 'add', 'remove', 'edit', 'on', 'off'. - name (optional, string): A human-readable name for the host entry, displayed in reports. - string (required, string): The host or network to filter. Networks can be specified using CIDR notation (e.g., IP/bits). - acsrf (required for actions other than 'list', string): An Anti-CSRF token, obtained via an 'empty' request, required for 'add', 'remove', 'edit', 'on', 'off' actions to confirm operations. Response Structure (HTTP GET): { "acsrf" : STR, // Anti-CSRF token "action" : STR, // The action performed in the request "filtering" : STR, // Status of host filtering ('on' or 'off') "elements" : [ { "name" : STR, // Name of the host entry "string" : STR // The host/network string }, ... ], // List of configured host entries "result" : { "name" : STR, // Name of the processed object "string" : STR // String identifier of the processed object (e.g., host/network) }, // Details of the object that was added, removed, or modified "error" : INT, // Error code (0 for success) "errorinfo" : STR, // Detailed technical description of the error "message" : STR // User-friendly error message ... } Field Descriptions: - acsrf: CSRF token for request security. - filtering: Indicates if host/network hit filtering is enabled ('on') or disabled ('off'). - action: The action performed in the request. - result: JSON object representing the processed item (added, removed, or modified). The 'string' field serves as a unique identifier. - error: 0 indicates success, otherwise it's an error code. - errorinfo: Technical details about the error. - message: Human-readable error message. - elements[].string: The host or network identifier. - elements[].name: The name associated with the host entry. ``` -------------------------------- ### Get Rating Categories API Source: https://top.mail.ru/help/ru/api/main Retrieves a list of rating categories and their subcategories. The response includes an array of categories, each with an ID, number, name, and an optional array of child categories. This endpoint is useful for understanding the site's categorization structure. ```APIDOC Endpoint: /json/categories Method: HTTP GET Description: Retrieves a list of rating categories and their subcategories. Response Structure: { "categories" : [ { "id" : STR, "number" : NUM, "name" : STR, "childs" : [ { "id": STR, "name": STR }, ... ], }, ... ] } Field Descriptions: - categories[].id: Unique identifier for the parent category. - categories[].number: Index or order of the category. - categories[].name: Name of the category. - categories[].childs[].id: Unique identifier for a subcategory. - categories[].childs[].name: Name of the subcategory. ``` -------------------------------- ### Visits Dynamics Parameters Source: https://top.mail.ru/help/ru/api/params Specific parameters for the 'Visits Dynamics' report to control the completeness of data and the depth of historical data retrieval. ```APIDOC Parameters: - full (yes): Include periods without visits in the output. By default, these periods are omitted. - back (number): Depth of data retrieval in days for visit dynamics. ```