{"repo":"phantomstudios/next-gtm","free":true,"listed":false,"github":"https://github.com/phantomstudios/next-gtm","clone":"git clone https://github.com/phantomstudios/next-gtm.git","description":"A lightweight Next library to implement custom Google Tag Manager events.","language":"TypeScript","stars":15,"topics":["react","next","nextjs","gtm","googletagmanager","lightweight","typescript","tagmanager","analytics"],"license":"MIT","category":"analytics","readme_excerpt":"@phntms/next-gtm [![NPM version][npm-image]][npm-url] [![Actions Status][ci-image]][ci-url] [![PR Welcome][npm-downloads-image]][npm-downloads-url] A lightweight Next library to implement custom Google Tag Manager events. Introduction Extends @phntms/react-gtm with native support for Next.JS 12, utilizing the new Script Component to automatically prioritize loading of third-party scripts to improve performance . Installation Install this package with npm . Usage &lt;TrackingHeadScript / Property Type Default Notes -------------- --------- --------- -------------------------------------------------------------------------------------------------------- id string undefined ID that uniquely identifies GTM Container. Example format: GTM-xxxxxx . disable boolean false Used to disable tracking events (isGTM=false only). Use if you want user to consent to cookies first isGTM boolean false Loads the gtag.js script by default (legacy behaviour - compatible with UA/GA4/GTM), else, loads gtm.js. GTMAuth string undefined (isGTM = true required) Optional parameter to load a non-default GTM environment, e.g. for testing GTM. GTMPreview string undefined (isGTM = true required) Optional parameter to load a non-default GTM environment, e.g. for testing GTM. To initialize GTM, add TrackingHeadScript to the head of the page. This package utilizes next/script, which means you can't place it inside a next/head . Further, TrackingHeadScript should not be used in pages/ document.js as next/script h","default_branch":null,"files":null,"tree":[],"storefront":"/r/phantomstudios","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/phantomstudios/next-gtm/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}