package.json 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. "name": "insight",
  3. "version": "0.4.3",
  4. "description": "Understand how your tool is being used by anonymously reporting usage metrics to an analtyics vendor, e.g. Google Analytics.",
  5. "keywords": [
  6. "npm",
  7. "package",
  8. "stats",
  9. "google",
  10. "analytics",
  11. "track",
  12. "metrics"
  13. ],
  14. "author": {
  15. "name": "Sindre Sorhus",
  16. "email": "sindresorhus@gmail.com",
  17. "url": "http://sindresorhus.com"
  18. },
  19. "main": "lib",
  20. "repository": {
  21. "type": "git",
  22. "url": "git://github.com/yeoman/insight"
  23. },
  24. "scripts": {
  25. "test": "mocha --reporter spec test/test.js"
  26. },
  27. "files": [
  28. "lib"
  29. ],
  30. "dependencies": {
  31. "async": "^0.9.0",
  32. "chalk": "^0.5.1",
  33. "configstore": "^0.3.1",
  34. "inquirer": "^0.6.0",
  35. "lodash.debounce": "^2.4.1",
  36. "object-assign": "^1.0.0",
  37. "os-name": "^1.0.0",
  38. "request": "^2.40.0",
  39. "tough-cookie": "^0.12.1"
  40. },
  41. "devDependencies": {
  42. "mocha": "*",
  43. "object-values": "^1.0.0",
  44. "sinon": "*"
  45. },
  46. "engines": {
  47. "node": ">=0.10.0"
  48. },
  49. "license": "BSD",
  50. "readme": "# Insight [![Build Status](https://secure.travis-ci.org/yeoman/insight.svg?branch=master)](http://travis-ci.org/yeoman/insight)\n\n> Understand how your tool is being used by anonymously reporting usage metrics to [Google Analytics](http://www.google.com/analytics/)\nor [Yandex.Metrica](http://metrica.yandex.com/)\n\n\n## Access data / generate dashboards\n\n### Google Analytics (GA)\n\n- Use [Embed API](https://developers.google.com/analytics/devguides/reporting/embed/v1/) to embed charts\n- Use [Core Reporting API](https://developers.google.com/analytics/devguides/reporting/core/v3/) or [Real Time Reporting API](https://developers.google.com/analytics/devguides/reporting/realtime/v3/) to access raw data, then build custom visualization, e.g. [metrics from Bower](http://bower.io/stats/)\n- Use GA's dashboards directly, e.g. metrics from [Yeoman](http://yeoman.io):\n\n![analytics screenshot](screenshot-ga-dashboard.png)\n\n\n## Provider Setup\n\n### Google Analytics (GA)\n\nCurrently Insight should to be used with GA set up as web tracking due to use of URLs. Future plan include refactoring to work with GA set up for app-based tracking and the [Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/).\n\nFor debugging, Insight can track OS version, node version and version of the app that implements Insight. Please set up custom dimensions per below screenshot. This is a temporary solution until Insight is refactored into app-based tracking.\n\n![GA custom dimensions screenshot](screenshot-ga-custom-dimensions.png)\n\n\n## Collected Data\n\nInsight cares deeply about the security of your user's data, and strives to be fully transparent with what it tracks. All data is sent via HTTPS secure connections. Insight provides API to offer an easy way for users to opt-out at any time.\n\nBelow is what Insight is capable of tracking. Individual implementation can choose to not track some items.\n\n- The version of the module that implements Insight\n- Module commands (e.g. install / search)\n- Name and version of packages involved with command used\n- Version of node.js & OS for developer debugging\n- A random & absolutely anonymous ID\n\n\n## Usage\n\n### Google Analytics\n\n```js\nvar Insight = require('insight');\nvar pkg = require('./package.json');\n\nvar insight = new Insight({\n\t// Google Analytics tracking code\n\ttrackingCode: 'UA-XXXXXXXX-X',\n\tpackageName: pkg.name,\n\tpackageVersion: pkg.version\n});\n\n// ask for permission the first time\nif (insight.optOut === undefined) {\n\treturn insight.askPermission();\n}\n\ninsight.track('foo', 'bar');\n// recorded in Analytics as `/foo/bar`\n```\n\n### Yandex.Metrica\n\n```js\nvar Insight = require('insight');\nvar pkg = require('./package.json');\n\nvar insight = new Insight({\n\t// Yandex.Metrica counter id\n\ttrackingCode: 'XXXXXXXXX'\n\ttrackingProvider: 'yandex',\n\tpackageName: pkg.name,\n\tpackageVersion: pkg.version\n});\n\n// ask for permission the first time\nif (insight.optOut === undefined) {\n\treturn insight.askPermission();\n}\n\ninsight.track('foo', 'bar');\n// recorded in Yandex.Metrica as `http://<package-name>.insight/foo/bar`\n```\n\nor a [live example](https://github.com/yeoman/yeoman)\n\n\n## API\n\n### Insight(settings)\n\n#### trackingCode\n\n**Required** \nType: `string`\n\nYour Google Analytics [trackingCode](https://support.google.com/analytics/bin/answer.py?hl=en&answer=1008080) or Yandex.Metrica [counter id](http://help.yandex.com/metrika/?id=1121963).\n\n#### trackingProvider\n\nType: `string` \nDefault: `'google'`\n\nTracking provider to use. \nPossible values are `'google'` or `'yandex'`.\n\n#### packageName\n\n**Required** \nType: `string`\n\nRequires you to also specify `packageVersion`.\n\n#### packageVersion\n\nType: `string` \nDefault: `'0.0.0'`\n\nRequires you to also specify `packageName`.\n\n#### config\n\nType: `object` \nDefault: An instance of [`configstore`](https://github.com/yeoman/configstore)\n\nIf you want to use your own configuration mechanism instead of the default\n`configstore`-based one, you can provide an object that has to implement two\nsynchronous methods:\n\n- `get(key)`\n- `set(key, value)`\n\n\n### Instance methods\n\n#### .track(keyword, [keyword, ...])\n\nAccepts keywords which ends up as a path in Analytics.\n\n`.track('init', 'backbone')` becomes `/init/backbone`\n\n#### .askPermission([message, callback])\n\nAsks the user permission to opt-in to tracking and sets the `optOut` property in `config`. You can also choose to set `optOut` property in `config` manually.\n\n![askPermission screenshot](screenshot-askpermission.png)\n\nOptionally supply your own `message` and `callback`. If `message` is `null`, default message will be used. The callback will be called with the arguments `error` and `optIn` when the prompt is done, and is useful for when you want to continue the execution while the prompt is running.\n\n\n#### .optOut\n\nReturns a boolean whether the user has opted out of tracking. Should preferably only be set by a user action, eg. a prompt.\n\n\n## License\n\n[BSD license](http://opensource.org/licenses/bsd-license.php) and copyright Google\n",
  51. "readmeFilename": "readme.md",
  52. "bugs": {
  53. "url": "https://github.com/yeoman/insight/issues"
  54. },
  55. "homepage": "https://github.com/yeoman/insight",
  56. "_id": "insight@0.4.3",
  57. "_shasum": "76d653c5c0d8048b03cdba6385a6948f74614af0",
  58. "_from": "insight@0.4.3",
  59. "_resolved": "https://registry.npmjs.org/insight/-/insight-0.4.3.tgz"
  60. }