handlebars-helper-track

0.1.1 • Public • Published

{{track}} NPM version

{{track}} handlebars helper to simplify adding Google analytics tracking codes.

Visit Google's documentation and Google's event tracking guide to learn more.

Quickstart

Install the helper with: npm install handlebars-helper-track

Gruntfile config

If you use Assemble and Grunt, in your project's Gruntfile add handlebars-helper-track to the helpers option in the Assemble task or target options:

grunt.initConfig({
  assemble: {
    options: {
      helpers: ['handlebars-helper-track', 'other/helpers/*.js']
    },
    files: {}
  }
});

Note that the 'handlebars-helper-track' module must also be listed in devDependencies for Assemble to automatically resolve the helper.

Alternatively you can register the helper with Assemble by adding handlebars-helper-track to both the devDependencies and the keywords array in your project's package.json.

Usage with Assemble

With that completed, you may now use the {{track}} helper in your templates:

{{track 'foo'}}

Please report any bugs or feature requests, thanks!

Options

foo

Type: String Default: undefined

TODO


Contributing

Find a bug? Have a feature request? Please create an Issue.

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt, and build the documentation with grunt-readme.

Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!

Related projects

Here are some other Handlebars helpers you might be interested in from the Assemble core team.

  • handlebars-helper-aggregate: {{aggregate}} handlebars helper. inlines content from multiple files optionally using wildcard (globbing/minimatch) patterns. uses YAML front matter as context for each file. optionally pass in a sorting function.
  • handlebars-helper-compose: {{compose}} handlebars helper. Similar to {{aggregate}}, but this is a block expression helper that inlines content from multiple files differently, extracting YAML front matter to pass to context for each file. Optionally use wildcard (globbing/minimatch) patterns. Accepts compare function as 3rd parameter for sorting inlined files.
  • handlebars-helper-condense: Remove extra newlines from HTML content.
  • handlebars-helper-eachitems: {{eachItems}} handlebars helper.
  • handlebars-helper-jade: {{jade}} handlebars helper, for converting basic Jade templates to HTML.
  • handlebars-helper-less: {{less}} handlebars helper. This helper allows you to use LESS inside style tags in your HTML. By default, the resulting CSS will be rendered inside the <style>...</style> tags of the rendered HTML, but you may alternatively define a destination path using the dest hash option of the helper.
  • handlebars-helper-lorem: {{lorem}} handlebars helper, for generating lorem lorem placeholder text.
  • handlebars-helper-minify: {{minify}} handlebars helper, for minification of HTML with html-minifier.
  • handlebars-helper-moment: {{moment}} handlebars helper. Combines the powers of Assemble, Handlebars.js and Moment.js into a great helper to master time.
  • handlebars-helper-not: {{not}} handlebars helper. Conditionally render a block if the condition is false. This block helper is really just a semantic alternative to {{isnt}}
  • handlebars-helper-paginate: {{paginate}} handlebars helper. Made for Assemble, the static site generator for Node.js, Grunt.js and Yeoman.
  • handlebars-helper-pkg: {{pkg}} handlebars helper, for retrieving a value from your project's package.json
  • handlebars-helper-post: {{post}} handlebars helper, for including a post, or a list of posts.
  • handlebars-helper-prettify: {{prettify}} handlebars helper, for formatting ("beautifying") HTML, CSS and JavaScript.
  • handlebars-helper-process: {{process}} handlebars helper, for processing raw templates in included content, with the correct context
  • handlebars-helper-repeat: {{repeat}} handlebars helper, for duplicating a block of content n times.
  • handlebars-helper-slugify: Convert strings into URL slugs.

Visit assemble.io/helpers for more information about using helpers with Assemble.

Author

Jon Schlinkert

Brian Woodward

License

Copyright (c) 2013 Jon Schlinkert, contributors. Released under the MIT license


This file was generated by grunt-readme on Tuesday, December 3, 2013.

Package Sidebar

Install

npm i handlebars-helper-track

Weekly Downloads

1

Version

0.1.1

License

none

Last publish

Collaborators

  • doowb
  • jonschlinkert