
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
app-usage-stats
Advanced tools
A convention for tracking javascript application usage, making full use of custom dimensions and metrics.
Example
const UsageStats = require('app-usage-stats')
const stats = new UsageStats('UA-987654321')
UsageStats ⏏
Array.<object>Array.<object>stringUsageStats ⏏Kind: Exported class
Extends: UsageStats
| Param | Type | Description |
|---|---|---|
| tid | string | Google Analytics tracking ID |
| [options] | object | |
| [options.dimensionMap] | object | A custom dimension name to ID Map. |
| [options.metricMap] | object | A custom metric name to ID Map. |
| [options.sendInterval] | object | If specified, stats will be sent no more frequently than this period. |
Array.<object>Stats not yet sent.
Kind: instance property of AppUsageStats
Array.<object>Stats sent.
Kind: instance property of AppUsageStats
stringQueued stats path. Defaults to ~/.usage-stats/${trackingId}-unsent.json.
Kind: instance property of AppUsageStats
Track a hit. The magic dimension name will be mapped to a GA screenView.
Kind: instance method of AppUsageStats
| Param | Type | Description |
|---|---|---|
| dimension | Array.<object> | dimension-value maps |
| metric | Array.<object> | metric-value maps |
| [options] | object | |
| [options.timeout] | number | A maxium wait period in ms, after which any pending requests will be aborted. |
| [options.send] | number | Each hit will be sent. |
Save stats
Kind: instance method of AppUsageStats
Save stats sync.
Kind: instance method of AppUsageStats
Load stats
Kind: instance method of AppUsageStats
Loads stats sync.
Kind: instance method of AppUsageStats
Send and reset stats.
Kind: instance method of AppUsageStats
| Param | Type | Description |
|---|---|---|
| [options] | object | |
| [options.timeout] | number | A maxium wait period in ms, after which any pending requests will be aborted. |
© 2016-17 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.
FAQs
A convention for tracking javascript application usage
The npm package app-usage-stats receives a total of 1,923 weekly downloads. As such, app-usage-stats popularity was classified as popular.
We found that app-usage-stats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.