{"_id":"@am0nshi/react-yandex-metrika","_rev":"1-9180298241b850fdfb1606a0fc9ee686","name":"@am0nshi/react-yandex-metrika","dist-tags":{"latest":"2.6.1"},"versions":{"2.6.1":{"name":"@am0nshi/react-yandex-metrika","version":"2.6.1","description":"Yandex Metrika component for React","main":"./lib/index.js","module":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"webpack","build:exp":"rm -rf lib && cross-env NODE_ENV=production ./node_modules/.bin/babel src/ --out-dir lib --ignore ./src/__test__","prepare":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/am0nshi/react-yandex-metrika.git"},"keywords":["react-component","react","yandex-metrika","component"],"author":{"name":"Alex Sladkov","email":"sladkov@gmail.com"},"license":"MIT","dependencies":{"babel-loader":"^8.2.2","webpack":"^5.23.0"},"devDependencies":{"@babel/cli":"^7.2.3","@babel/core":"^7.3.4","@babel/preset-env":"^7.3.4","babel-eslint":"^10.0.1","eslint":"^5.15.1","eslint-plugin-react":"^7.10.0","prop-types":"^15.5.10","react":"^16.0.0","webpack-cli":"^4.5.0"},"peerDependencies":{"prop-types":"*","react":"*"},"bugs":{"url":"https://github.com/am0nshi/react-yandex-metrika/issues"},"homepage":"https://github.com/am0nshi/react-yandex-metrika#readme","directories":{"lib":"lib"},"gitHead":"b970317d89fd480d9a6804ff3602f59171da27c1","_id":"@am0nshi/react-yandex-metrika@2.6.1","_nodeVersion":"13.12.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-a3Ym+PbzPv8z8el2gwlMbJSzPZU8wAm40tocVVQ+Lrp5bCG3zYmv+4/PiupcD5JyRE87ztCb/dJq/Thfy/39PQ==","shasum":"bb7a87af8cfd6b8ea3f12a7485c64c65ccbcaa08","tarball":"https://registry.npmjs.org/@am0nshi/react-yandex-metrika/-/react-yandex-metrika-2.6.1.tgz","fileCount":19,"unpackedSize":17346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhMq77CRA9TVsSAnZWagAA98gP/1fy7CutAYaKL8SgPIzJ\nBgF2Y8zlG1DaWV58IuA7H5PT8pOSdUaZ71sz/yB1IcX3kXIH2I4jhoGyvmmD\nUUDgwZxkX7Pzq4s3T+i4i7WHXJse6TMymgOxVX6HFTnbRUmx2yojxxbHfTJ2\nd1heiXDP5X9bC7W26HEclhZmh47eQTbT2Gr9XQi5yOjnGDhOQgBumLSs2ffI\no0vrAAvL0gEBalVMFnUwK0XQteTw51sJGPO5NqGY+FnUiEERzstV7H7E3HeV\ncYefoSwu4xsG42E814rY/xbCEDg0pP6UoOKqMEVMxER7UTasLo5xNMLK6CwO\nSdz9uqdvfCJSuU5uE2AwCYwiFbeUGXNUxOiqfUn5HYtYget3WhZ150NcaDUn\nzEltVOQglJOTeIO4u9J5DXoEUyB5OLlo9Sjjr4f45LD51nGDwxWUd/nzpyj1\nRE7xOSqDqOge6gQpeDE9ljrAkC2mqewTUx21WCweqp3YwStjIPrBlL9u0oTG\nT8oAHAth0c4H2z4DMY+WcFZq4Bj68nydfNxu/EVPr+ajTqfFaidaDMRVyBxr\nONlLQcXkZY9lil2LWg4ko6DOc80ZrKzrfOpTwBGUpgybWtIU1Fluxn0w9XAm\nW93ZRlNFedU3dnVKbU/sGcPvfDhAUZeSLZrOpCPxUzbqQSrWkwD1XaKjJwuW\n4qEZ\r\n=PjoH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHyvjG91odn6th/ULiBo8hjJg3U/PvBftgb38j4ThO0jAiAUvjZzfxSwkqI6JC0eqZdslVjmEj+e2KudaH621KVgDg=="}]},"_npmUser":{"name":"galaevnik","email":"galaevnik@yandex.ru"},"maintainers":[{"name":"galaevnik","email":"galaevnik@yandex.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-yandex-metrika_2.6.1_1630711546750_0.9236027311680395"},"_hasShrinkwrap":false}},"time":{"created":"2021-09-03T23:25:46.665Z","2.6.1":"2021-09-03T23:25:47.040Z","modified":"2022-04-04T13:42:30.578Z"},"maintainers":[{"name":"galaevnik","email":"galaevnik@yandex.ru"}],"description":"Yandex Metrika component for React","homepage":"https://github.com/am0nshi/react-yandex-metrika#readme","keywords":["react-component","react","yandex-metrika","component"],"repository":{"type":"git","url":"git+https://github.com/am0nshi/react-yandex-metrika.git"},"author":{"name":"Alex Sladkov","email":"sladkov@gmail.com"},"bugs":{"url":"https://github.com/am0nshi/react-yandex-metrika/issues"},"license":"MIT","readme":"react-yandex-metrika\n======================\n\nAdds the Yandex.Metrika script to your page and exposes the `ym` tracking\nfunction as a module.\n\nInspired by and shamelessly copied from [react-google-analytics](https://github.com/hzdg/react-google-analytics).\n\nUsage:\n\nUse the initializer to add the script to your page somewhere:\n```javascript\nimport { YMInitializer } from 'react-yandex-metrika';\n\nclass MyComponent extends React.Component {\n  render() {\n    return (\n      <div>\n        // SNIP\n          <YMInitializer accounts={[987654321]} />\n        // SNIP\n      </div>\n    );\n  }\n});\n```\n\nPlease note that you need to initialize the tracker object only once.\nBecause of that, you should insert initializer to the place where it won't be remounted (that means at least outside of router scope).  \nIf you want to use [webvisor](https://metrika.yandex.ru/promo/webvisor), you should pass `options={{webvisor: true}}` to to `YMInitializer`, for example:\n```\n<YMInitializer accounts={[987654321]} options={{webvisor: true}}/>\n```\n\n\nYou can create several identical trackers (that might be useful for domain-wise segmentation).\n```javascript\n<YMInitializer accounts={[98765, 4321]} />\n```\n\nYou can also specify options for tracker (as described in [Yandex.Metrika documentation](https://help.yandex.ru/metrika/objects/creating-object.xml)):\n```javascript\n<YMInitializer accounts={[98765]} options={{defer: true}} />\n```\n\nElsewhere, use the `ym` function:\n\n```javascript\nimport ym from 'react-yandex-metrika';\nym('hit', '/cart');\nym('reachGoal', 'whateverGoal', {awesomeParameter: 42});\n```\n\n### Webvisor 2.0 support\n\nSee [#6](https://github.com/narkq/react-yandex-metrika/issues/6) for details.\n```javascript\n<YMInitializer accounts={[31337]} options={{webvisor: true}} version=\"2\" />\n```\n\n### Migration from 1.0\n\n- Replace `import { Initializer }` to `import { YMInitializer }`.\n- Remove `ym.init()` call. Pass arguments of `ym.init` as props to the `YMInitializer` component.\n  Tracking will be initialized on `YMInitializer.componentDidMount`.\n\n### Publish\nnpm login && npm publish --access public\n","readmeFilename":"README.md"}