Skip to content

Asynchronously load segment.com analytics.js with an npm module

License

Notifications You must be signed in to change notification settings

yocontra/analytics.js-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

analytics.js-loader

This is the segment.com snippet as a module.

Slightly modified to be browserify compatible.

Install

npm install analytics.js-loader --save

Usage

require('analytics.js-loader')({
  writeKey: 'YOUR_WRITE_KEY',
  // you can skip the first analytics.page() call if needed, #1
  skipPageCall: false
});

global.analytics.identify('1e810c197e', {
  name: 'Bill Lumbergh',
  email: 'bill@initech.com'
});

global.analytics.track('Signed Up', {
  plan: 'Startup',
  source: 'Analytics Academy'
});

About

Asynchronously load segment.com analytics.js with an npm module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%