
A seamless integration for injecting Google Tag Manager snippets into Astro projects, supporting popular web analytics tools.
The Astro Google Tag Manager integration provides a smooth solution for adding Google Tag Manager (GTM) snippets into your Astro projects. This tool supports various web analytics tools, enhancing your website's tracking capabilities. With a straightforward installation process and accessible components, it simplifies the implementation of GTM for developers and businesses looking to optimize their data collection strategies.
The package includes essential features that allow for flexible customization, enabling users to inject GTM scripts, set up site verification, and leverage advanced capabilities like Partytown for improved performance. Whether you're managing a personal website or a larger web application, this integration helps you ensure that your tracking is both efficient and compliant with data regulations.
GoogleTagmanager Component: Easily injects the Google Tag Manager script into your project by passing your GTM measurement ID. Optionally, specify a custom domain and container path for added flexibility.
GoogleTagmanagerNoscript Component: Provides a reliable no-script fallback for GTM, which should be placed immediately after the opening <body> tag.
GoogleTagmanagerPartytown Component: Enhances performance by offloading GTM script execution to a web worker. This component also requires the GTM measurement ID for setup.
SiteVerification Component: Allows you to add site verification meta tags effortlessly by passing your verification ID. Different names can be assigned for various vendors to ensure compatibility.
Custom Domain Support: The component enables self-hosting of GTM containers, which is essential for server-side tracking and compliance with data privacy regulations.
Multiple Usage for Site Verification: Easily verify your site with various services using different site verification names by leveraging this component multiple times.
Flexible Configuration Options: Customize container paths and domains as needed to tailor the integration to your specific implementation requirements.
Installation Ease: The package can be installed quickly using npm or yarn, making it accessible for developers with varying levels of experience.

Astro is the all-in-one web framework designed for speed. Pull your content from anywhere and deploy everywhere, all powered by your favorite UI components and libraries.
A website that uses Google Analytics to track website performance and user behavior. This includes features such as website traffic monitoring, conversion tracking, and audience segmentation to gain insights and optimize website performance.
TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.