reach-et-webpack-google-tag-manager-plugin

1.6.2 • Public • Published

Webpack Google Tag Manager Plugin

A clean and easy way to add Google Tag Manager support to your web project.

This is a fixed version of Webpack Google Tag Manager Plugin for ET projects

Installation

  npm i --save-dev reach-et-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 'reach-et-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 'reach-et-webpack-google-tag-manager-plugin'

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

Copyright (c) 2019 "Reach Shared Services Ltd"

Package Sidebar

Install

npm i reach-et-webpack-google-tag-manager-plugin

Weekly Downloads

1

Version

1.6.2

License

MIT

Unpacked Size

7.13 kB

Total Files

5

Last publish

Collaborators

  • trinitymirrordigital-admin