# gulp-gtm-plugin

> Add Google Tag Manager support to your web project.

Latest version **1.0.4** (published 2021-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-gtm-plugin
pnpm add gulp-gtm-plugin
yarn add gulp-gtm-plugin
bun add gulp-gtm-plugin
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-10-11 |
| First published | 2021-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yurayarosh |
| Maintainers | yurayarosh |
| Keywords | gtm, google tag manager, gulp google tag manager, gulp gtm |

## Links

- npm: https://www.npmjs.com/package/gulp-gtm-plugin
- Repository: https://github.com/yurayarosh/gulp-gtm-plugin
- Issues: https://github.com/yurayarosh/gulp-gtm-plugin/issues
- npm.io page: https://npm.io/package/gulp-gtm-plugin

## Recent versions

- 1.0.4 (latest) — 2021-10-11
- 1.0.3 — 2021-10-06
- 1.0.2 — 2021-10-05
- 1.0.1 — 2021-10-05
- 1.0.0 — 2021-10-05

## README

# Gulp Google Tag Manager Plugin

So that is basically [webpack-google-tag-manager-plugin](https://github.com/timjorjev/webpack-google-tag-manager-plugin),
but fixed some bugs and made it to use with gulp.

## Installation

```bash
$ npm i gulp-gtm-plugin -D
```

```bash
$ yarn add gulp-gtm-plugin -D
```

## How to use

```js
const gulp = require('gulp')
const gtm  = require('gulp-gtm-plugin')

gulp.task('html', () =>
  gulp.src('./index.html')
  .pipe(gtm({
      id: 'GTM-1234'
  }))
  .pipe(gulp.dest('./'))
)
```

## Default options

```js
gtm({
  id: '',
  events: {},
  dataLayer: {},
  dataLayerName: 'dataLayer',
  auth: '',
  preview: '',
  cookiesWin: '', // Add `gtm_cookies_win` query to url (cookiesWin: 'x' => gtm_cookies_win=x)
})
```

---
_Source: https://npm.io/package/gulp-gtm-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
