react-google-tag-manager
This repository contains a react based implementation for
Google's Tag Manager snippet.
Motivation & Expectation
We like to use Google's Tag Manager in our React Stack. We wrap it into a component because
it makes it testable. And based on our agreement every component needs to be tested.
Other requirements for the GTM implementation are:
- provide a GTM-ID
- provide additional events on script initialization (optional)
- provide a name for the datalayer (optional)
- works for server-side-rendering and client-side-rendering
- contains tests
- installable via npm