🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

handlebars-helper-analytics

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handlebars-helper-analytics

Handlebars helper for adding Google Analytics scripts to the head and/or footer of a webpage.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

{{analytics}} NPM version

Handlebars helper for adding Google Analytics scripts to the head and/or footer of a webpage.

Install

Install with npm:

npm i handlebars-helper-analytics --save-dev

To use with Assemble, make sure you also specify the helper in the Assemble options, e.g.:

options: {
  helpers: ['handlebars-helper-analytics']
}

Usage

{{analytics [context] [placement]}}

Assuming you have the following data object:

google: {
  analytics: {
    account: "UA-XXXXXX",
    domain: "assemble.github.io"
    siteid: "XXXXXXX"
  }
}

You would pass the google.analytics object as context to the helper, like this:

{{analytics google.analytics 'head'}}
{{analytics google.analytics 'footer'}}

placement

  • head will render the script that should be used in the <head></head>
  • footer will render the script that should be used in the footer, e.g. last thing inside the <body></body> tag.

Author

License

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

This file was generated by verb-cli on July 11, 2014.

Keywords

handlebars-helper

FAQs

Package last updated on 12 Jul 2014

Did you know?

Socket

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.

Install

Related posts