solid-google-tag-manager
v1.1.2
Published
Embed Google Tag Manager in your Solid app to enable tracking and analytics.
Downloads
96
Maintainers
Readme
A simple library to load the google tag manager script into your solid-start application to enable tracking and analytics.
Install
npm i solid-google-tag-managerUsage
Embed the created element at the level you want the tag to be loaded. If this is to be loaded for all routes, it can be added directly in the top level app.jsx / app.tsx file.
app.js
import { createGoogleTagManagerElement } from "solid-google-tag-manager";
export default function App() {
return (
// ...
<Suspense>{createGoogleTagManagerElement("G-XXXXXXXX")}</Suspense>
// ...
);
}