https://github.com/bendrucker/load-segment
Load Segment's analytics.js library asynchronously with method queueing
https://github.com/bendrucker/load-segment
Last synced: over 1 year ago
JSON representation
Load Segment's analytics.js library asynchronously with method queueing
- Host: GitHub
- URL: https://github.com/bendrucker/load-segment
- Owner: bendrucker
- License: mit
- Created: 2016-05-03T23:57:24.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T19:30:04.000Z (over 7 years ago)
- Last Synced: 2025-04-10T08:14:02.765Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# load-segment [](https://travis-ci.org/bendrucker/load-segment)
> Load Segment's analytics.js library asynchronously with method queueing
## Install
```
$ npm install --save load-segment
```
## Usage
```js
var Segment = require('load-segment')
var analytics = Segment({key: 'myWriteKey'})
analytics.track('MyEvent')
```
## API
#### `Segment(options)` -> `object`
Returns a queue interface that accumulates calls to Segment while it loads and proxies them once it arrives.
##### options
*Required*
Type: `object`
Segment configuration. Currently only `key` is supported and required.
## License
MIT © [Ben Drucker](http://bendrucker.me)