The package is distributed using npm, the node package manager.
npm i --save @lomray/google-tag-manager
import GoogleTagManager from '@lomray/google-tag-manager';
const manager = new GoogleTagManager();
useEffect(() => {
manager.init({ gtmId: GTM_ID });
}, []);
const onButtonClick = () => {
manager.pushEvent({ my: 'data' });
}
Bug or a feature request, please open a new issue.
Made with 💚
Published under MIT License.