UNPKG

@phntms/react-gtm

Version:

A lightweight React library to implement custom Google Tag Manager events.

9 lines (6 loc) 213 B
import { IS_BROWSER } from "./platform"; const enableTracking = (id: string, enable = true) => { if (!IS_BROWSER) return; window[`ga-disable-${id}`] = (!enable).toString(); }; export default enableTracking;