{"id":18376752,"url":"https://github.com/hcodes/server_yametrika_nodejs","last_synced_at":"2026-03-07T12:35:28.268Z","repository":{"id":12928710,"uuid":"15606384","full_name":"hcodes/server_yametrika_nodejs","owner":"hcodes","description":"Серверное отслеживание посетителей с помощью Яндекс.Метрики для Node.js","archived":false,"fork":false,"pushed_at":"2023-07-18T21:22:49.000Z","size":122,"stargazers_count":19,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-08T10:58:34.853Z","etag":null,"topics":["analytics","javascript","metrika","nodejs","tracking-api","yandex"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/yametrika","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hcodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-01-03T09:52:31.000Z","updated_at":"2025-04-14T15:13:19.000Z","dependencies_parsed_at":"2024-11-06T00:27:26.037Z","dependency_job_id":"a8dc840b-fc26-4520-9bf5-e3d842c67457","html_url":"https://github.com/hcodes/server_yametrika_nodejs","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/hcodes/server_yametrika_nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fserver_yametrika_nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fserver_yametrika_nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fserver_yametrika_nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fserver_yametrika_nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hcodes","download_url":"https://codeload.github.com/hcodes/server_yametrika_nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hcodes%2Fserver_yametrika_nodejs/sbom","scorecard":{"id":458698,"data":{"date":"2025-08-11","repo":{"name":"github.com/hcodes/server_yametrika_nodejs","commit":"7ce3ff53847c0d11cd9bb9d7565aa76d4576a73c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T10:29:48.109Z","repository_id":12928710,"created_at":"2025-08-19T10:29:48.109Z","updated_at":"2025-08-19T10:29:48.109Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30213187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T12:15:00.571Z","status":"ssl_error","status_checked_at":"2026-03-07T12:15:00.217Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","javascript","metrika","nodejs","tracking-api","yandex"],"created_at":"2024-11-06T00:24:38.559Z","updated_at":"2026-03-07T12:35:28.245Z","avatar_url":"https://github.com/hcodes.png","language":"JavaScript","readme":"# Серверное отслеживание посетителей с помощью Яндекс.Метрики для Node.js\n[![NPM version](https://img.shields.io/npm/v/yametrika.svg)](https://www.npmjs.com/package/yametrika)\n[![NPM Downloads](https://img.shields.io/npm/dm/yametrika.svg?style=flat)](https://www.npmjs.org/package/yametrika)\n[![install size](https://packagephobia.com/badge?p=yametrika)](https://packagephobia.com/result?p=yametrika)\n\n\nВ некоторых случаях требуется отслеживать действия на стороне сервера.\n\nНапример:\n+ Слежка за поисковыми роботами\n+ Редиректы\n+ Загрузка файлов\n+ Страницы с ошибками (403, 404, 500)\n+ RSS\n+ Время выполнения скриптов\n+ Время запросов к базам данных\n+ Треккинг AJAX-запросов\n+ и пр.\n\n## Возможности\n+ Загрузка страницы - hit()\n+ Внешняя ссылка - extLink()\n+ Загрузка файла - file()\n+ Параметры визита - params()\n+ Неотказ - notBounce()\n\n## Настройки счётчика Метрики\n**В настройках счётчика во вкладке «Фильтры» / «Фильтрация роботов» необходимо выбрать опцию «Учитывать посещения всех роботов». В противном случае, статистика собираться не будет.**\n\n## Ограничения\nОтчёты, которые будут недоступны в Метрике при серверной отправки:\n+ Половозрастная структура\n+ Пол и возраст\n+ Разрешения дисплеев\n+ Версия Flash\n+ Вебвизор, аналитика форм\n+ Карта кликов\n\nУникальные посетители считаются по user agent'у и IP-адресу.\n\n## Установка\n`npm install yametrika`\n\n## Использование\n```js\nvar http = require('http');\n\n// Создаем счётчик, 12345 — номер счётчика\nvar counter = require('yametrika').counter({id: 12345});\n\nhttp.createServer(function (req, res) {\n    res.writeHead(200, {'Content-Type': 'text/plain'});\n    res.end('okay');\n\n    // Заполняем счётчик данными (referer, ip и ua) из запроса к серверу.\n    counter.req(req);\n\n    // Страница https://example.com, с заголовком 'Main page'\n    // переход был с реферером https://othersite.com\n    counter.hit('https://example.com', 'Main page', 'https://othersite.com');\n}).listen(8080);\n```\n\n## Отправка хита\n```js\n/**\n * @param {string} pageUrl - Адрес страницы.\n * @param {string} [pageTitle] - Заголовок страницы.\n * @param {string} [pageRef] - Реферер страницы.\n * @param {Object} [userParams] - Параметры визитов.\n * @param {string} [ut] - Для запрета индексирования 'noindex'\n *\n * @returns {Object} this\n */\ncounter.hit('https://mysite.org', 'Main page', 'https://google.com/...');\n\n// С запретом на индексирование и параметрами визитов\ncounter.hit('https://mysite.org', 'Main page', 'https://google.com/...', {level1: {level2: 1}}, 'noindex');\n```\n\n## Достижение цели\n```js\n/**\n * @param {string} target - Название цели.\n * @param {Object} [userParams] - Параметры визитов.\n *\n * @returns {Object} this\n */\ncounter.hit();\ncounter.reachGoal('goalName');\n\n// или\n\n// С параметрами визитов\ncounter.hit();\ncounter.reachGoal('goalName', {level1: {level2: 1}});\n```\nВызов метода `hit()` перед `reachGoal()` необходим для корректной привязки цели к визиту.\n\n## Внешняя ссылка\n```js\n/**\n * @param {string} url - Адрес страницы.\n * @param {string} [title] - Заголовок страницы.\n *\n * @returns {Object} this\n */\ncounter.extLink('https://nodejs.org');\n```\n\n## Загрузка файла\n```js\n/**\n * @param {string} file - Ссылка на файл.\n * @param {string} [title] - Заголовок страницы.\n *\n * @returns {Object} this\n */\ncounter.file('https://mysite.org/secret.zip');\n```\n\n## Параметры визитов\n```js\n/**\n * @param {...*} data - Параметры визитов.\n *\n * @returns {Object} this\n */\ncounter.params({level1: {level2: {level3: 1}}});\n\n// или\ncounter.params('level1', 'level2', 'level3', 1);\n```\n\n## Не отказ\n```js\n/**\n * @returns {Object} this\n */\ncounter.notBounce();\n```\n\n## Полезные ссылки\n+ [Версия для PHP](https://github.com/hcodes/server_yametrika/)\n+ [Помощь Яндекс.Метрики](https://yandex.ru/support/metrika/)\n\n## Лицензия\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcodes%2Fserver_yametrika_nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhcodes%2Fserver_yametrika_nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhcodes%2Fserver_yametrika_nodejs/lists"}