Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yurayarosh/gulp-gtm-plugin
Add Google Tag Manager support to your web project.
https://github.com/yurayarosh/gulp-gtm-plugin
Last synced: about 2 months ago
JSON representation
Add Google Tag Manager support to your web project.
- Host: GitHub
- URL: https://github.com/yurayarosh/gulp-gtm-plugin
- Owner: yurayarosh
- Created: 2021-10-05T14:05:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-11T12:33:20.000Z (about 3 years ago)
- Last Synced: 2024-10-17T03:26:30.756Z (3 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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)
})
```