Gatsby Plugin Gtag screenshot

Gatsby Plugin Gtag

Author Avatar Theme by Flpvsk
Updated: 17 Feb 2020
28 Stars

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

Overview:

The gatsby-plugin-gtag is a powerful tool designed to seamlessly integrate Google Analytics into your Gatsby site using the modern gtag.js library. It aims to replace the older gatsby-plugin-google-analytics by providing updated functionality without relying on deprecated scripts. This plugin not only helps in tracking user interactions but also includes additional features for outbound link tracking, making it a versatile choice for developers looking to enhance their site’s analytics capabilities.

With the gatsby-plugin-gtag, you can maintain an organized codebase while ensuring your site takes full advantage of the latest Google Analytics features. The straightforward usage of the OutboundLink component makes it easy to implement tracking for external links, giving you valuable insights into user behavior and interactions across different platforms.

Features:

  • Outbound Link Tracking: Easily implement analytics for external links with the OutboundLink component, just like standard anchor tags.
  • Head Placement Option: Control where the tracking script is placed; by default, it goes in the body, but you can choose to render it in the head for faster loading.
  • Anonymize IP: Automatically includes the anonymize_ip flag, ensuring that you respect user privacy while tracking analytics.
  • Development Mode Testing: Facilitates testing in development mode by allowing you to enable Google Analytics easily without affecting production settings.
  • MIT License: Open-source and community-driven, the MIT license makes it easy to integrate and customize according to your needs.
  • Seamless Integration: Designed specifically for Gatsby, ensuring that it works flawlessly with your site’s architecture and flow.