reach-et-webpack-google-tag-manager-plugin
v1.6.2
Published
A clean and easy way to add Google Tag Manager support to your web project.
Downloads
20
Maintainers
Readme
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"