google-tag-manager
Integrate Google Tag Manager into VuePress.
This plugin will import Google Tag Manager.
Usage
npm i -D @vuepress/plugin-google-tag-manager@nextimport { googleTagManagerPlugin } from '@vuepress/plugin-google-tag-manager'
export default {
plugins: [
googleTagManagerPlugin({
// options
id: 'GTM-XXXXXXXXXX',
}),
],
}Working with Javascript Disabled
If you want Google Tag Manager to work properly when javascript is disabled, you should add the following content to the body part of build template via templateBuild:
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-ABCDEFGH"
height="0"
width="0"
style="display:none;visibility:hidden"
></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->Options
idRequired
stringThe container ID of Google Tag Manager, which should start with 'GTM-'.
You can add your container and find its ID.
