1.0.3 • Published 5 years ago

webpack-google-tag-manager-plugin v1.0.3

Weekly downloads
111
License
MIT
Repository
github
Last release
5 years ago

npm npm

Installation

  npm i --save-dev webpack-google-tag-manager-plugin
  yarn add --dev webpack-google-tag-manager-plugin

Examples

Webpack basic configuration for setting up the plugin

import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import GoogleTagManagerPlugin from 'webpack-google-tag-manager-plugin'

module.exports = {
    ...
    plugins: [
        new HtmlWebpackPlugin({
          ...
        }),
        new GoogleTagManagerPlugin({
            id: 'your-container-id',
        }),
    ],
}

Webpack configuration for making use of your environments

import webpack from 'webpack'
import HtmlWebpackPlugin from 'html-webpack-plugin'
import GoogleTagManagerPlugin from 'webpack-google-tag-manager-plugin'

module.exports = {
    ...
    plugins: [
        new HtmlWebpackPlugin({
          ...
        }),
        new GoogleTagManagerPlugin({
            id: 'your-container-id',
            auth: 'your-auth-value',
            preview: 'your-environment-value',
        }),
    ],
}

License

Webpack Google Tag Manager Plugin is published under MIT License.

Collaboration

If you have any questions, please contact me via e-mail. For issues, please open an issue!