@trinitymirrordigital/cue-webpack-google-tag-manager-plugin
v2.0.6-alpha.0
Published
Webpack plugin to add google tag manager
Downloads
107
Maintainers
Keywords
Readme
@trinitymirrordigital/cue-webpack-google-tag-manager-plugin
This is a fixed version of Webpack Google Tag Manager Plugin for Reach projects
Installation
yarn add --dev @trinitymirrordigital/cue-webpack-google-tag-manager-plugin
npm i --save-dev @trinitymirrordigital/cue-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 '@trinitymirrordigital/cue-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 '@trinitymirrordigital/cue-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) 2022 "Reach Shared Services Ltd"