https://github.com/doodzik/metalsmith-google-analytics
a metalsmith plugin to add google analytics to your html site
https://github.com/doodzik/metalsmith-google-analytics
Last synced: over 1 year ago
JSON representation
a metalsmith plugin to add google analytics to your html site
- Host: GitHub
- URL: https://github.com/doodzik/metalsmith-google-analytics
- Owner: doodzik
- License: mit
- Created: 2015-12-05T09:40:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-07T15:43:28.000Z (over 10 years ago)
- Last Synced: 2025-04-09T11:04:16.898Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# metalsmith-google-analytics
A Metalsmith plugin to add the google analytics code to all html files
## Installation
```
$ npm install --save metalsmith-google-analytics
```
## Example
```javascript
var Metalsmith = require('metalsmith')
var googleAnalytics = require('metalsmith-google-analytics')
Metalsmith(__dirname)
// Build your full site here...
.use(googleAnalytics('API-KEY'))
.build()
```
### Options
### googleAnalytics(apiKey [,asyncScript])
#### `asyncScript` (optional)
( default: true )
- specify if you want to load the synchronous or asynchronous script
(doesn't support ie9)