{"name":"gatsby-plugin-google-analytics","description":"Gatsby plugin to add google analytics onto a site","version":"2.0.0-alpha.e328d33f","author":{"name":"Kyle Mathews","email":"mathews.kyle@gmail.com"},"bugs":{"url":"https://github.com/gatsbyjs/gatsby/issues"},"dependencies":{"@babel/runtime":"7.0.0-beta.51"},"devDependencies":{"@babel/cli":"7.0.0-beta.51","@babel/core":"7.0.0-beta.51","cross-env":"^5.1.4"},"homepage":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics#readme","keywords":["gatsby","gatsby-plugin","google analytics"],"license":"MIT","main":"index.js","peerDependencies":{"gatsby":">2.0.0-alpha"},"repository":{"type":"git","url":"https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics"},"scripts":{"build":"babel src --out-dir . --ignore **/__tests__","prepublish":"cross-env NODE_ENV=production npm run build","watch":"babel -w src --out-dir . --ignore **/__tests__"},"readmeFilename":"README.md","readme":"# gatsby-plugin-google-analytics\n\nEasily add Google Analytics to your Gatsby site.\n\n## Install\n\n`npm install --save gatsby-plugin-google-analytics`\n\n## How to use\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-plugin-google-analytics`,\n      options: {\n        trackingId: \"YOUR_GOOGLE_ANALYTICS_TRACKING_ID\",\n        // Puts tracking script in the head instead of the body\n        head: false,\n        // Setting this parameter is optional\n        anonymize: true,\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      },\n    },\n  ],\n}\n```\n\n## `<OutboundLink>` component\n\nTo make it easy to track clicks on outbound links in Google Analytics,\nthe 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\nimport { OutboundLink } from 'gatsby-plugin-google-analytics'\n\nexport default () => {\n  <div>\n    <OutboundLink\n      href=\"https://www.gatsbyjs.org/packages/gatsby-plugin-google-analytics/\"\n    >\n      Visit the Google Analytics plugin page!\n    </OutboundLink>\n  </div>\n}\n```\n\n## The \"anonymize\" option\n\nSome countries (such as Germany) require you to use the\n[\\_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for\nGoogle Analytics. Otherwise you are not allowed to use it. The option adds two\nblocks to the code:\n\n```javascript\nfunction gaOptout(){document.cookie=disableStr+'=true; expires=Thu, 31 Dec 2099 23:59:59 UTC;path=/',window[disableStr]=!0}var gaProperty='UA-XXXXXXXX-X',disableStr='ga-disable-'+gaProperty;document.cookie.indexOf(disableStr+'=true')>-1&&(window[disableStr]=!0);\n\n...\n\nga('set', 'anonymizeIp', 1);\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();\">Deactive Google Analytics</a>`\n\n## The \"respectDNT\" option\n\nIf you enable this optional option, Google Analytics will not be loaded at all for visitors that have \"Do Not Track\" enabled. While using Google Analytics does not necessarily constitute Tracking, you might still want to do this to cater to more privacy oriented users.\n\n## The \"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","_id":"gatsby-plugin-google-analytics@2.0.0-alpha.e328d33f","dist":{"shasum":"1d7645ab7ec3e51461bd4f12af4eb748aeefe3f5","tarball":"http://registry-npm.ywwl.com/gatsby-plugin-google-analytics/download/gatsby-plugin-google-analytics-2.0.0-alpha.e328d33f.tgz","fileCount":7,"unpackedSize":7836,"integrity":"sha512-4RE6qWAmyjIBdPf8CzHEnsDg6uc2GNYdoWc9tAiptwehzHkYNLFk6vjdjRor4GnNbe4cGo7NJWs2zxgXqxZW9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLETGGdqow2QXmuP3YpriqkBZGZVECDgMeGf0M6AmaVAiEA5n90JGt8fOKILwyedjBpizs+xsR5K7yj3bBMTaKVwco="}],"size":3290,"noattachment":false,"key":"/gatsby-plugin-google-analytics/-/gatsby-plugin-google-analytics-2.0.0-alpha.e328d33f.tgz"},"maintainers":[{"email":"mathews.kyle@gmail.com","name":"kylemathews"},{"email":"michael.allanson@gmail.com","name":"m-allanson"},{"email":"monastic.panic@gmail.com","name":"monastic.panic"},{"email":"misiek.piechowiak@gmail.com","name":"pieh"}],"_npmUser":{"name":"kylemathews","email":"mathews.kyle@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-google-analytics_2.0.0-alpha.e328d33f_1529177558496_0.7330483198826403"},"_hasShrinkwrap":false,"publish_time":1529177558572,"_cnpm_publish_time":1529177558572,"dist-tags":{"alpha-9689ff":"4.23.0-alpha-9689ff.25","alpha-a5-peer":"4.23.0-alpha-a5-peer.70","alpha-qe-sm":"3.14.0-alpha-qe-sm.46","alpha-transformer-json":"4.14.0-alpha-transformer-json.26","alpha-ts-jit":"4.6.0-alpha-ts-jit.60","alpha-v5":"5.0.0-alpha-v5.d20221012t101120.57","dev-ssr-2":"2.3.14-dev-ssr-2.390","drupal-proxyurl":"5.0.0-alpha-drupal-proxyurl.14","drupal-self-reference":"4.18.0-alpha-drupal-self-reference.18","image-helpers":"2.6.0-image-helpers.58","image-service":"4.8.0-alpha-image-service.24","latest":"5.16.0","latest-v3":"3.15.0","latest-v4":"4.25.0","next":"5.17.0-next.0","otp-test":"2.1.12-otp-test.31","preview-gh-api":"4.23.0-alpha-preview-gh-api.26","reach-router":"3.0.0-reach-router.143","react19":"5.18.0-react19.1","unifiedroutes":"2.2.4-unifiedroutes.76","v3rc":"3.0.0-v3rc.0","wp-image-cdn-auth":"4.15.0-alpha-wp-image-cdn-auth.48"}}