solid-google-tag-manager

1.1.2 • Public • Published

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-manager

Usage

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>
    // ...
  );
}

Package Sidebar

Install

npm i solid-google-tag-manager

Weekly Downloads

1

Version

1.1.2

License

ISC

Unpacked Size

1.66 kB

Total Files

3

Last publish

Collaborators

  • frde.me