All Projects → flpvsk → gatsby-plugin-gtag

flpvsk / gatsby-plugin-gtag

Licence: MIT license
Gatsby plugin to add Google Analytics gtag.js (replacement for analytics.js) to a site.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gatsby-plugin-gtag

gatsby-plugin-csp
A Gatsby plugin which adds strict Content Security Policy to your project.
Stars: ✭ 40 (+42.86%)
Mutual labels:  gatsby-plugin
gatsby-plugin-disqus
💬 A plugin for adding Disqus comments to GatsbyJS
Stars: ✭ 40 (+42.86%)
Mutual labels:  gatsby-plugin
gatsby-theme-nehalem
A Gatsby blog theme.
Stars: ✭ 168 (+500%)
Mutual labels:  gatsby-plugin
gatsby-plugin-lunr
Gatsby plugin for full text search implementation based on lunr client-side index. Supports multilanguage search.
Stars: ✭ 69 (+146.43%)
Mutual labels:  gatsby-plugin
gatsby-source-firestore
Gatsby source plugin for building websites using the Firestore as a data source.
Stars: ✭ 30 (+7.14%)
Mutual labels:  gatsby-plugin
gatsby-theme-gallery
🏞 A Gatsby Theme for adding a gallery to your site.
Stars: ✭ 40 (+42.86%)
Mutual labels:  gatsby-plugin
gatsby-attila-theme-ghost
A Gatsby theme plugin for creating blogs from headless Ghost CMS.
Stars: ✭ 16 (-42.86%)
Mutual labels:  gatsby-plugin
gatsby-remark-embedded-codesandbox
A Gatsby Remark plugin for embedding Codesandbox given a folder of files
Stars: ✭ 31 (+10.71%)
Mutual labels:  gatsby-plugin
gatsby-plugin-optimize-svgs
A Gatsby Plugin to minify SVGs output to the filesystem during the build.
Stars: ✭ 39 (+39.29%)
Mutual labels:  gatsby-plugin
gatsby-plugin-robots-txt
Gatsby plugin that automatically creates robots.txt for your site
Stars: ✭ 105 (+275%)
Mutual labels:  gatsby-plugin
gatsby-plugin-prettier-build
prettify gatsby build output
Stars: ✭ 30 (+7.14%)
Mutual labels:  gatsby-plugin
gatsby-remark-emojis
🚀 Processes emoji in markdown and inlines <img> tags with the corresponding base64 representation of the image.
Stars: ✭ 28 (+0%)
Mutual labels:  gatsby-plugin
gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-50%)
Mutual labels:  gatsby-plugin
gatsby-i18n
Gatsby plugin that provides i18n support
Stars: ✭ 25 (-10.71%)
Mutual labels:  gatsby-plugin
chandrikadeb7.github.io
Personal portfolio website hosted using GitHub Pages - Version 2
Stars: ✭ 99 (+253.57%)
Mutual labels:  gatsby-plugin
gatsby-source-stripe
Gatsby source plugin for building websites using Stripe as a data source
Stars: ✭ 71 (+153.57%)
Mutual labels:  gatsby-plugin
gatsby-source-moltin
🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
Stars: ✭ 21 (-25%)
Mutual labels:  gatsby-plugin
gatsby-remark-highlight-code
Adds stylish cards and syntax highlighting to code blocks in markdown files
Stars: ✭ 63 (+125%)
Mutual labels:  gatsby-plugin
gatsby-plugin-matomo
🥂 Gatsby plugin to add Matomo (formerly Piwik) onto a site.
Stars: ✭ 56 (+100%)
Mutual labels:  gatsby-plugin
gatsby-theme-deck-n-blog
Create a deck (with mdx-deck) and a blog post from the same MDX
Stars: ✭ 17 (-39.29%)
Mutual labels:  gatsby-plugin

gatsby-plugin-gtag

Add Google Analytics gtag.js to a site

Does the same thing as gatsby-plugin-google-analytics, but instead of adding deprecated analytics.js script, it uses gtag.js. Includes Outbound Link module.

Install

npm install --save gatsby-plugin-gtag

Use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-gtag`,
      options: {
        // your google analytics tracking id
        trackingId: `UA-XXXXXXXX-X`,
        // Puts tracking script in the head instead of the body
        head: false,
        // enable ip anonymization
        anonymize: true,
      },
    },
  ],
}

Outbound Links

import { OutboundLink } from 'gatsby-plugin-gtag'

Use like any other anchor tag in your component: <OutboundLink href='yourwebsite.example'>Check out this site!</OutboundLink>

Options

head

Puts tracking script in the head instead of the body. Default is false (render in the body)

anonymize

Adds anonymize_ip flag when calling gtag. More info here.

Testing in development mode

By default gatsby-plugin-gtag will only load and run google analytics when process.env.NODE_ENV === 'production'. To enable gtag in development mode set the environment variable GATSBY_GTAG_DEBUG=true gatsby develop.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].