0.2.0 • Published 2 years ago

@burst/react-gtm v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@burst/react-gtm

The React Google Tag Manager module is great for implementing all GTM stuff.

Usage

First in _document.tsx, add these 2 components:

import { GtmBody, GtmHead } from "@burst/react-gtm";
const containerId = "GTM-XXXXXX";

render(
  <Html>
    <Head>
      <GtmHead containerId={containerId} />
    </Head>
    <body>
      <GtmBody containerId={containerId} />
    </body>
  </Html>
);

After this, use the track function to track any preconfigured event.