Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

segmentio/hbs-analyticsjs-snippet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hbs-analyticsjs-snippet

Handlebars helper for the analytics.js snippet.

Installation

$ npm install hbs-analyticsjs-snippet

Example

var snippet = require('hbs-analyticsjs-snippet');
var hbs = require('hbs');

hbs.registerHelper('analyticsjs', snippet('WRITE_KEY'));
 <script>
    {{ analyticsjs }}
  </script>

API

snippet(writeKey, options)

Creates a handlebars helper for the analytics.js snippet, with a writeKey and custom options:

{
  min: true, // minified snippet by default
  host: 'cdn.segment.com' // where your analytics.js is hosted
}

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

About

Handlebars helper for the analytics.js snippet

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5