{"_id":"@emdgroup-liquid/gatsby-plugin-google-gtag","_rev":"1-ca644c646378b1bd3220024f6f7526ac","name":"@emdgroup-liquid/gatsby-plugin-google-gtag","dist-tags":{"latest":"5.9.2"},"versions":{"5.9.1":{"name":"@emdgroup-liquid/gatsby-plugin-google-gtag","description":"Gatsby plugin to add google gtag onto a site","version":"5.9.1","author":{"name":"Tyler Buchea","email":"tyler@buchea.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"^7.20.13","minimatch":"^3.1.2"},"devDependencies":{"@babel/cli":"^7.20.7","@babel/core":"^7.20.12","babel-preset-gatsby-package":"^3.9.0-next.0","cross-env":"^7.0.3"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-gtag#readme","keywords":["gatsby","gatsby-plugin","google gtag","google global site tag"],"license":"MIT","main":"index.js","peerDependencies":{"gatsby":"^5.0.0-next","react":"^18.0.0 || ^0.0.0","react-dom":"^18.0.0 || ^0.0.0"},"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-gtag"},"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":">=18.0.0"},"types":"./index.d.ts","gitHead":"88317b517b2bb135e88e8be42768da42f590691f","_id":"@emdgroup-liquid/gatsby-plugin-google-gtag@5.9.1","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-uciVLG5IrVpidT8PvXfn0TZy6afggCelrDVHLp8g3lidp958H8kXuxpI4lKMj9Ue9Q9n3E2PyZaFO6PBKh21qQ==","shasum":"79f28b4c23f40f74a8282d9803c72cba435f1620","tarball":"https://registry.npmjs.org/@emdgroup-liquid/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.9.1.tgz","fileCount":8,"unpackedSize":50105,"signatures":[{"keyid":"SHA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"},"_npmUser":{"name":"renet","email":"reneschubert@gmx.de"},"directories":{},"maintainers":[{"name":"to4stedtoast","email":"marco.koeppel@googlemail.com"},{"name":"renet","email":"reneschubert@gmx.de"},{"name":"bdiakur","email":"boris.diakur@merckgroup.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-google-gtag_5.9.1_1681915722882_0.4678898167430934"},"_hasShrinkwrap":false},"5.9.2":{"name":"@emdgroup-liquid/gatsby-plugin-google-gtag","description":"Gatsby plugin to add google gtag onto a site","version":"5.9.2","author":{"name":"Tyler Buchea","email":"tyler@buchea.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"^7.20.13","minimatch":"^3.1.2"},"devDependencies":{"@babel/cli":"^7.20.7","@babel/core":"^7.20.12","babel-preset-gatsby-package":"^3.9.0-next.0","cross-env":"^7.0.3"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-gtag#readme","keywords":["gatsby","gatsby-plugin","google gtag","google global site tag"],"license":"MIT","main":"index.js","peerDependencies":{"gatsby":"^5.0.0-next","react":"^18.0.0 || ^0.0.0","react-dom":"^18.0.0 || ^0.0.0"},"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-gtag"},"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":">=18.0.0"},"types":"./index.d.ts","gitHead":"bf27ab5725db39983527ff83690a8cd00fb286db","_id":"@emdgroup-liquid/gatsby-plugin-google-gtag@5.9.2","_nodeVersion":"18.14.2","_npmVersion":"9.5.0","dist":{"integrity":"sha512-lUBF/bHHZBJtsNh+x2jQwrETak0yTvFQn2i0GLya3ARbK2rxbdqa+UUS/Mm4VuYJJQn346BlQNSGfPe1GmEsbQ==","shasum":"81036ac4ac78191868dc922a0ceba4a0cc590e67","tarball":"https://registry.npmjs.org/@emdgroup-liquid/gatsby-plugin-google-gtag/-/gatsby-plugin-google-gtag-5.9.2.tgz","fileCount":8,"unpackedSize":50788,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzl62ESqts8/epPzy+nTd+tW8BpegaOsXtHFxbrO5MZAIhAL3PBWK6TVZm2Vbzl4THY9u0q1my0TQXhUCGyilscv+e"}]},"_npmUser":{"name":"renet","email":"reneschubert@gmx.de"},"directories":{},"maintainers":[{"name":"to4stedtoast","email":"marco.koeppel@googlemail.com"},{"name":"renet","email":"reneschubert@gmx.de"},{"name":"bdiakur","email":"boris.diakur@merckgroup.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-google-gtag_5.9.2_1688380607987_0.24944339117574232"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-19T14:48:42.804Z","5.9.1":"2023-04-19T14:48:43.062Z","modified":"2023-07-03T10:36:48.344Z","5.9.2":"2023-07-03T10:36:48.175Z"},"maintainers":[{"name":"to4stedtoast","email":"marco.koeppel@googlemail.com"},{"name":"renet","email":"reneschubert@gmx.de"},{"name":"bdiakur","email":"boris.diakur@merckgroup.com"}],"description":"Gatsby plugin to add google gtag onto a site","homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-gtag#readme","keywords":["gatsby","gatsby-plugin","google gtag","google global site tag"],"repository":{"type":"git","url":"git+https://github.com/gatsbyjs/gatsby.git","directory":"packages/gatsby-plugin-google-gtag"},"author":{"name":"Tyler Buchea","email":"tyler@buchea.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"license":"MIT","readme":"# gatsby-plugin-google-gtag\n\nEasily add Google Global Site Tag to your Gatsby site.\n\n> The global site tag (gtag.js) is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, Campaign Manager, Display & Video 360, and Search Ads 360.\n\nGlobal site tag (gtag.js) is meant to combine multiple Google tagging systems and can replace older ones such as [analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/) ([gatsby-plugin-google-analytics](https://www.gatsbyjs.com/plugins/gatsby-plugin-google-analytics/)).\n\nFor more general information on gtag you can read Google's official documentation on the subject: https://developers.google.com/gtagjs/.\n\nIf you're migrating from analytics.js (gatsby-plugin-google-analytics) you can read about the subtle API differences in more depth at: https://developers.google.com/analytics/devguides/migration/ua/analyticsjs-to-gtagjs.\n\n**Please note:** This plugin only works in production mode! To test your Global Site Tag is installed and firing events correctly run: `gatsby build && gatsby serve.`\n\n## Install\n\n```shell\nnpm install gatsby-plugin-google-gtag\n```\n\n## How to use\n\n```js\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-plugin-google-gtag`,\n      options: {\n        // You can add multiple tracking ids and a pageview event will be fired for all of them.\n        trackingIds: [\n          \"GA-TRACKING_ID\", // Google Analytics / GA\n          \"AW-CONVERSION_ID\", // Google Ads / Adwords / AW\n          \"DC-FLOODIGHT_ID\", // Marketing Platform advertising products (Display & Video 360, Search Ads 360, and Campaign Manager)\n        ],\n        // This object gets passed directly to the gtag config command\n        // This config will be shared across all trackingIds\n        gtagConfig: {\n          optimize_id: \"OPT_CONTAINER_ID\",\n          anonymize_ip: true,\n          cookie_expires: 0,\n        },\n        // This object is used for configuration specific to this plugin\n        pluginConfig: {\n          // Puts tracking script in the head instead of the body\n          head: false,\n          // Setting this parameter is also optional\n          respectDNT: true,\n          // Avoids sending pageview hits from custom paths\n          exclude: [\"/preview/**\", \"/do-not-track/me/too/\"],\n          // Defaults to https://www.googletagmanager.com\n          origin: \"YOUR_SELF_HOSTED_ORIGIN\",\n          // Delays processing pageview events on route update (in milliseconds)\n          delayOnRouteUpdate: 0,\n          // Key in local store where user consent is persisted\n          consentKey: \"example_localstore_key\",\n        },\n      },\n    },\n  ],\n}\n```\n\n## Custom Events\n\nThis plugin automatically sends a \"pageview\" event to all products given as \"trackingIds\" on every Gatsbys route change.\n\nIf you want to call a custom event you have access to `window.gtag` where you can call an event for all products:\n\n```js\nwindow.gtag(\"event\", \"click\", { ...data })\n```\n\nor you can target a specific product:\n\n```js\nwindow.gtag(\"event\", \"click\", { send_to: \"AW-CONVERSION_ID\", ...data })\n```\n\nIn either case don't forget to guard against SSR:\n\n```js\ntypeof window !== \"undefined\" && window.gtag(\"event\", \"click\", { ...data })\n```\n\n## `<OutboundLink>` component\n\nTo make it easy to track clicks on outbound links the plugin provides a component.\n\nTo use it, simply import it and use it like you would the `<a>` element e.g.\n\n```jsx\nimport React from \"react\"\nimport { OutboundLink } from \"gatsby-plugin-google-gtag\"\n\nexport default () => (\n  <div>\n    <OutboundLink href=\"https://www.gatsbyjs.com/plugins/gatsby-plugin-google-gtag/\">\n      Visit the Google Global Site Tag plugin page!\n    </OutboundLink>\n  </div>\n)\n```\n\n## The \"gtagConfig.anonymize_ip\" option\n\nSome countries (such as Germany) require you to use the\n[\\_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for\nGoogle Site Tag. Otherwise you are not allowed to use it. The option adds the\nblock of code below:\n\n```js\nfunction gaOptout() {\n  ;(document.cookie =\n    disableStr + \"=true; expires=Thu, 31 Dec 2099 23:59:59 UTC;path=/\"),\n    (window[disableStr] = !0)\n}\n\nvar gaProperty = \"UA-XXXXXXXX-X\",\n  disableStr = \"ga-disable-\" + gaProperty\ndocument.cookie.indexOf(disableStr + \"=true\") > -1 && (window[disableStr] = !0)\n```\n\nIf your visitors should be able to set an Opt-Out-Cookie (No future tracking)\nyou can set a link e.g. in your imprint as follows:\n\n`<a href=\"javascript:gaOptout();\">Deactivate Google Tracking</a>`\n\n## The \"gtagConfig.optimize_id\" option\n\nIf you need to use Google Optimize for A/B testing, you can add this optional Optimize container id to allow Google Optimize to load the correct test parameters for your site.\n\n## Other \"gtagConfig\" options\n\nThe `gtagConfig` is passed directly to the gtag config command, so you can specify everything it supports, e.g. `gtagConfig.cookie_name`, `gtagConfig.sample_rate`. If you're migrating from the analytics.js plugin, this means that all Create Only Fields should be snake_cased.\n\n## The \"pluginConfig.respectDNT\" option\n\nIf you enable this optional option, Google Global Site Tag will not be loaded at all for visitors that have \"Do Not Track\" enabled. While using Google Global Site Tag does not necessarily constitute Tracking, you might still want to do this to cater to more privacy oriented users.\n\n## The \"pluginConfig.exclude\" option\n\nIf you need to exclude any path from the tracking system, you can add it (one or more) to this optional array as glob expressions.\n\n## The \"pluginConfig.delayOnRouteUpdate\" option\n\nIf you need to delay processing pageview events on route update (e.g. to wait for page transitions with [`gatsby-plugin-transition-link`](https://www.gatsbyjs.com/plugins/gatsby-plugin-transition-link/)), then this option adds a delay before generating the pageview event.\n\n### \"pluginConfig.consentKey\" option\n\nWhen adding a `consentKey`, the plugin looks for the existence and the value of that key in the local storage of the browser. If the key exists and it's value equals `\"true\"`, the plugin works as usual, but otherwise nothing is being tracked.\n","readmeFilename":"README.md"}