@source4society/react-scepter-web-gtm-component
v1.0.2
Published
A simple Google Tag Manager component for the web
Downloads
1
Readme
react-scepter-web-gtm-component
A simple Google Tag Manager component for the web
Installation
npm install @source4society/react-scepter-web-gtm-component
or
yarn add @source4society/react-scepter-web-gtm-component
At least a single tag must be found in you document for this component to work.
Usage
Add this component to your web application to load a GTM container on mount. Note that if you are using a react-style router then you will likely have to add some logic for triggering GTM events upon navigation. This is best done inside of GTM itself. Example usage:
<GTMComponent containerId={'GTM-XXXXXXX'} />
where containerId is the ID of your GTM container.