New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gulp-gtag

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

gulp-gtag

Inject Google Analytics (gtag) into html with Gulp (gulpjs.com)

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

gulp-gtag

Injects Google Analytics (gtag) code into HTML files.

Build Status NPM version Dependency Status

Information

This is a fork of gulp-ga and has been modified to support the newer gtag script for Google Analytics.

Packagegulp-gtag
DescriptionInjects Google Analytics (gtag) code into HTML with Gulp (gulpjs.com)
Node Version>= 0.9
Gulp Version3.x

Usage

Install

$ npm install gulp-gtag --save-dev

Example

var gulp = require('gulp');
var gtag = require('gulp-gtag');

// Basic usage:
gulp.task('gtag', function(){
  gulp.src('./index.html')
  .pipe(gtag({uid: 'UA-12345678-1'}))
  .pipe(gulp.dest('./'));
});

Options

options.uid

Set the uid (required)

Type: `String`

Example:

.pipe(gtag({uid: 'UA-12345678-1'}))

options.tag

Set a specific tag to insert before it.

Type: `String`
Default: `head`

Example:

.pipe(gtag({tag: 'head'}))
.pipe(gtag({tag: 'body'}))

options.indent

Number of spaces for indentation (for formatting)

Type: `Number`
Default: `4`

Example:

.pipe(gtag({indent: 2}))

options.minify

Minify GA script code (remove \n and trailing whitespace).

Type: `Boolean`
Default: `false`

Example:

.pipe(gtag({minify: true}))

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:

.pipe(gtag({nonceTag: true}))

LICENSE

MIT License

Keywords

gulp

FAQs

Package last updated on 12 Apr 2018

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