{"_id":"@brandl-nutrition/gatsby-plugin-google-tagmanager","_rev":"1-1598d00bf394c826e3e02f5bfde64e03","name":"@brandl-nutrition/gatsby-plugin-google-tagmanager","dist-tags":{"latest":"4.15.0-next.2"},"versions":{"4.14.0-next.1":{"name":"@brandl-nutrition/gatsby-plugin-google-tagmanager","description":"Gatsby plugin to add google tagmanager onto a site","version":"4.14.0-next.1","author":{"name":"Thijs Koerselman","email":"thijs@vauxlab.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"^7.15.4","web-vitals":"^1.1.2"},"devDependencies":{"@babel/cli":"^7.15.4","@babel/core":"^7.15.5","babel-preset-gatsby-package":"^2.14.0-next.1","cross-env":"^7.0.3","gatsby-plugin-utils":"^3.8.0-next.1"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-tagmanager#readme","keywords":["gatsby","gatsby-plugin","google analytics","google tagmanager"],"license":"MIT","main":"index.js","peerDependencies":{"gatsby":"^4.0.0-next","react":"^16.9.0 || ^17.0.0 || ^18.0.0","react-dom":"^16.9.0 || ^17.0.0 || ^18.0.0"},"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-tagmanager"},"scripts":{"build":"babel src --out-dir . --ignore \"**/__tests__\"","prepare":"cross-env NODE_ENV=production npm run build","watch":"babel -w src --out-dir . --ignore \"**/__tests__\""},"engines":{"node":">=14.15.0"},"_id":"@brandl-nutrition/gatsby-plugin-google-tagmanager@4.14.0-next.1","_nodeVersion":"16.3.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-23Dxsdzl0i9M1gpQjrA65qm+S1FQj74rMHs4s/uUQQyJB24VcEWg6ERW/J8FOdD5rHcJmDQxnUrh8yTXYxV7zQ==","shasum":"27d4718770fbe2dcd1b913c1af40bff5ffc17b87","tarball":"https://registry.npmjs.org/@brandl-nutrition/gatsby-plugin-google-tagmanager/-/gatsby-plugin-google-tagmanager-4.14.0-next.1.tgz","fileCount":9,"unpackedSize":48428,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXFrfo+5+2EmHb/XQLax+5nTl5LJzAJEnPVxTEHr52DAiEAkXwMxaKjprC/VY+YoLWX8e/JHir8s7APR+bcAkSsf+4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiakXzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9eA//ZMnuCR6f9BmpN1ASX5ttua4AsLTmJKUvrDm6acwIRFmrz6c5\r\nSBfA/eVhc7TpyAzK9qDpnibyHDDyRFAkXUNnwcYkcpUsSnh0hqU0EEygEBfX\r\nYLXNV4agromI8EUX31WFn8tyyveQ//9Kq9JU5gfY9kuR2rvKRrL8tDcjhr6Q\r\nEyjORPE5QP+JxYUneLMeywZcNn38BiDaIQn2EJfcGYXrhtbDX4hxpj4S5ZZe\r\nkJTioN+kFX8FYAP/FME66WkaBpVo5+HS6Pf4Q1KELHqELydR2Xr9BOpEhyDm\r\nleS3J2pmoapcSVxs8TccUO8g7uOpJOtHoPyFDrNS7eI0Sj3B4JvRkqqa12D8\r\nrEpiF/e00S8RIGjNR3peJDmbJ9QJTRGTMoN0VbXg3sOtx38jBK7PfOdoSIrG\r\n0NLjBw/coJXub92OpDjxRdCfsbPF2i2MZyLc8vx5TsCRYinvLUdFKoJrTcD3\r\nyh2qqeO1tMLOp0P+NoJlevQRQpCQEEhTRsCI+9qpYV6juO6vVymU3EkZsOWA\r\nIMaPO8B3ib3Fdw253MFvyB/4vVXSXX0YbhnbVQfZVzzgjXP6KPJFT8kd95pL\r\nn5ib2RSV7RL59IgEO7rNtoS/GMIxVMQzAuVWE7zfgSLG8rRKVB/wCQ8W5xlq\r\nI4ASdOKN/0nnMssqJ1pwTnRi3T4r2z4ieeI=\r\n=RQJH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aseipel","email":"alex@brandl-nutrition.de"},"directories":{},"maintainers":[{"name":"aseipel","email":"alex@brandl-nutrition.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-google-tagmanager_4.14.0-next.1_1651131891419_0.2043538061988346"},"_hasShrinkwrap":false},"4.15.0-next.2":{"name":"@brandl-nutrition/gatsby-plugin-google-tagmanager","description":"Gatsby plugin to add google tagmanager onto a site","version":"4.15.0-next.2","author":{"name":"Thijs Koerselman","email":"thijs@vauxlab.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"^7.15.4","web-vitals":"^1.1.2"},"devDependencies":{"@babel/cli":"^7.15.4","@babel/core":"^7.15.5","babel-preset-gatsby-package":"^2.15.0-next.0","cross-env":"^7.0.3","gatsby-plugin-utils":"^3.9.0-next.2"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-tagmanager#readme","keywords":["gatsby","gatsby-plugin","google analytics","google tagmanager"],"license":"MIT","main":"index.js","peerDependencies":{"gatsby":"^4.0.0-next","react":"^16.9.0 || ^17.0.0 || ^18.0.0","react-dom":"^16.9.0 || ^17.0.0 || ^18.0.0"},"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-tagmanager"},"scripts":{"build":"babel src --out-dir . --ignore \"**/__tests__\"","prepare":"cross-env NODE_ENV=production npm run build","watch":"babel -w src --out-dir . --ignore \"**/__tests__\""},"engines":{"node":">=14.15.0"},"gitHead":"fe50c500c9c3328e4a51225b02b95d7140b7aedb","_id":"@brandl-nutrition/gatsby-plugin-google-tagmanager@4.15.0-next.2","_nodeVersion":"16.3.0","_npmVersion":"8.9.0","dist":{"integrity":"sha512-qdjE3+RVo5JXL4xagOi0x53fa1rl8I/Uss1hIk7LmE3Y89p9dXTMTT/XH2rSzUxCQq+qYNbUQnRGEVBCrhqUug==","shasum":"c65d52de86d0f149ed5f89a2ffe7ef89381e0860","tarball":"https://registry.npmjs.org/@brandl-nutrition/gatsby-plugin-google-tagmanager/-/gatsby-plugin-google-tagmanager-4.15.0-next.2.tgz","fileCount":9,"unpackedSize":48734,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDN4TY7ETRbSoQ1Hu7JmRg3ahAGtqxrlwfroitTK22FwIhAPLMRpQ/qpvwq2Cd7e/6f46GYe63V5D/KdsrXgLKtOyW"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJigfwcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeBQ//WdTiwweeonWIyjMqogX5ji+LQ/OkQ6VW47GGuoJRwYqsAk8v\r\n8vr8/rKaG/4LslqkOuZQrndq2x+pO7YKWVViDe104u87k8WhvfzUwFjMbvrS\r\nHvhBng4Vd54QSVbnxkLgmt7yMua6mYUgz2mxdIpA66EpQw7ZqhU3GSSo2SW4\r\nfxOyiM8y+XyGJrVfHnsRqUaX+V8lZrfI6i3GNJng+fLi4YFTVPWSLTaUgmZx\r\nAzCqiFrtObOoZdzgJZneJ/AAJoGaJbvWicg2VLQNxUUibM97Rv+WWzpbrggS\r\n6zkcq3kMhhYK2HmoUdSXeJx6iJjyJJj61e/bQmxg19D9SC0WOIh509/aQqSi\r\nZqJ5ZE9MieJSAfW0HmTfUolVobWSnpQJXX45S4YKd8IecrBWBrb+1e6woT46\r\nnUt2xH/Fj0G0CLEDGGfcLtv7Dcrf/zbNw71gOtT8w0Uz59R1UT3UHp1ij99F\r\n7PQG6Tw9KFjmvGp5updZOnQKGcfCE94E2s2I1ukI6lWNprltf5i83UzMYPOE\r\niZAkauR6fXBTuOkUfgfl7BQusH6YdaQlli6LXSGWk8VboLKMqoyZUJ2i/fMk\r\nJZQDhIN9T2/BG02VGq/thu2lnAWaZ27tJ0fzVgpkiQW6bW9rUHMUDMU5Tz+A\r\nxy1A10qJ1PGXw3igOCQKzqkoe+p6286PbSQ=\r\n=2xjw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"aseipel","email":"alex@brandl-nutrition.de"},"directories":{},"maintainers":[{"name":"aseipel","email":"alex@brandl-nutrition.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-google-tagmanager_4.15.0-next.2_1652685851972_0.12497454508336414"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-28T07:44:51.363Z","4.14.0-next.1":"2022-04-28T07:44:51.583Z","modified":"2022-05-16T07:24:12.208Z","4.15.0-next.2":"2022-05-16T07:24:12.114Z"},"maintainers":[{"name":"aseipel","email":"alex@brandl-nutrition.de"}],"description":"Gatsby plugin to add google tagmanager onto a site","homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-tagmanager#readme","keywords":["gatsby","gatsby-plugin","google analytics","google tagmanager"],"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-tagmanager"},"author":{"name":"Thijs Koerselman","email":"thijs@vauxlab.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"license":"MIT","readme":"# gatsby-plugin-google-tagmanager\n\nEasily add Google Tagmanager to your Gatsby site.\n\n## Install\n\n`npm install gatsby-plugin-google-tagmanager`\n\n## How to use\n\n```javascript\n// In your gatsby-config.js\nplugins: [\n  {\n    resolve: \"gatsby-plugin-google-tagmanager\",\n    options: {\n      id: \"YOUR_GOOGLE_TAGMANAGER_ID\",\n\n      // Include GTM in development.\n      //\n      // Defaults to false meaning GTM will only be loaded in production.\n      includeInDevelopment: false,\n\n      // datalayer to be set before GTM is loaded\n      // should be an object or a function that is executed in the browser\n      //\n      // Defaults to null\n      defaultDataLayer: { platform: \"gatsby\" },\n\n      // Specify optional GTM environment details.\n      gtmAuth: \"YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_AUTH_STRING\",\n      gtmPreview: \"YOUR_GOOGLE_TAGMANAGER_ENVIRONMENT_PREVIEW_NAME\",\n      dataLayerName: \"YOUR_DATA_LAYER_NAME\",\n\n      // Name of the event that is triggered\n      // on every Gatsby route change.\n      //\n      // Defaults to gatsby-route-change\n      routeChangeEventName: \"YOUR_ROUTE_CHANGE_EVENT_NAME\",\n      // Defaults to false\n      enableWebVitalsTracking: true,\n      // Defaults to https://www.googletagmanager.com\n      selfHostedOrigin: \"YOUR_SELF_HOSTED_ORIGIN\",\n      // Paths to exclude\n      // In case of a string, will check if the string is included in the path\n      // In case of a regex, will check if the path matches it\n      //\n      // Defaults to []\n      excludedPaths: [\"EXCLUDED_PATH\", /EXCLUDED_REGEX/],\n    },\n  },\n]\n```\n\nIf you like to use data at runtime for your defaultDataLayer you can do that by defining it as a function.\n\n```javascript\n// In your gatsby-config.js\nplugins: [\n  {\n    resolve: \"gatsby-plugin-google-tagmanager\",\n    options: {\n      // datalayer to be set before GTM is loaded\n      // should be a stringified object or object\n      //\n      // Defaults to null\n      defaultDataLayer: function () {\n        return {\n          pageType: window.pageType,\n        }\n      },\n    },\n  },\n]\n```\n\nThis plugin only initiates the tag manager _container_. If you want to use Google Analytics, please also add `gatsby-plugin-google-analytics`.\n\nIf you want to link analytics use with anything inside the container (for example, a cookie consent manager such as OneTrust), you will need to ensure that the tag manager script comes _before_ the analytics script in your `gatsby-config.js`.\n\n#### Tracking routes\n\nThis plugin will fire a new event called `gatsby-route-change` (or as in the `gatsby-config.js` configured `routeChangeEventName`) whenever a route is changed in your Gatsby application. To record this in Google Tag Manager, we will need to add a trigger to the desired tag to listen for the event:\n\n1. Visit the [Google Tag Manager console](https://tagmanager.google.com/) and click on the workspace for your site.\n2. Navigate to the desired tag using the 'Tags' tab of the menu on the right hand side.\n3. Under \"Triggering\", click the pencil icon, then the \"+\" button to add a new trigger.\n4. In the \"Choose a trigger\" window, click on the \"+\" button again.\n5. Choose the trigger type by clicking the pencil button and clicking \"Custom event\". For event name, enter `gatsby-route-change` (or as in the `gatsby-config.js` configured `routeChangeEventName`).\n\nThis tag will now catch every route change in Gatsby, and you can add Google tag services as you wish to it.\n\n#### Tracking Core Web Vitals\n\nOptimizing for the quality of user experience is key to the long-term success of any site on the web. Capturing Real user metrics (RUM) helps you understand the experience of your user/customer. By setting `enableWebVitalsTracking` to `true`, GTM will get [\"core-web-vitals\"](https://web.dev/vitals/) events with their values.\n\nYou can save this data in Google Analytics or any database of your choosing.\n\nWe send three metrics:\n\n- **Largest Contentful Paint (LCP)**: measures loading performance. To provide a good user experience, LCP should occur within 2.5 seconds of when the page first starts loading.\n- **First Input Delay (FID)**: measures interactivity. To provide a good user experience, pages should have a FID of 100 milliseconds or less.\n- **Cumulative Layout Shift (CLS)**: measures visual stability. To provide a good user experience, pages should maintain a CLS of 0.1. or less.\n\n#### Note\n\nOut of the box this plugin will simply load Google Tag Manager on the initial page/app load. It's up to you to fire tags based on changes in your app. See the above \"Tracking routes\" section for an example.\n","readmeFilename":"README.md"}