gulp-gtag
Injects Google Analytics (gtag) code into HTML files.
Information
This is a fork of gulp-ga and has been modified to support the newer gtag script for Google Analytics.
Package | gulp-gtag |
Description | Injects Google Analytics (gtag) code into HTML with Gulp (gulpjs.com) |
Node Version | >= 0.9 |
Gulp Version | 3.x |
Usage
Install
$ npm install gulp-gtag --save-dev
Example
var gulp = ;var gtag = ; // Basic usage:gulp;
Options
options.uid
Set the uid (required)
Type: `String`
Example:
options.tag
Set a specific tag to insert before it.
Type: `String`
Default: `head`
Example:
options.indent
Number of spaces for indentation (for formatting)
Type: `Number`
Default: `4`
Example:
options.minify
Minify GA script code (remove \n
and trailing whitespace).
Type: `Boolean`
Default: `false`
Example:
options.nonceTag
Add a nonce attribute and a nonce template to the script tag. So that we can implement a Content Security Policy that does not allow unsafe-inline scripts to be loaded.
Type: `Boolean`
Default: `false`
Example: