Spaces:
Runtime error
Runtime error
Download utils/gtm.ts from ewnewq/stable-diffusion-tpu: direct link, hf CLI and curl.
- Browser
- Download file 423 Bytes
-
https://huggingface.co/spaces/ewnewq/stable-diffusion-tpu/resolve/main/utils/gtm.ts
- Command line
-
hf download hf://spaces/ewnewq/stable-diffusion-tpu/utils/gtm.ts
-
curl -L -o gtm.ts https://huggingface.co/spaces/ewnewq/stable-diffusion-tpu/resolve/main/utils/gtm.ts
423 Bytes
| // lib/gtm.ts | |
| type WindowWithDataLayer = Window & { | |
| dataLayer: Record<string, any>[] | |
| } | |
| declare const window: WindowWithDataLayer | |
| export const GTM_ID = "GTM-WKJGXLNK" | |
| export const pageview = (url: string) => { | |
| if (typeof window.dataLayer !== "undefined") { | |
| window.dataLayer.push({ | |
| event: "pageview", | |
| page: url, | |
| }) | |
| } else { | |
| console.log({ | |
| event: "pageview", | |
| page: url, | |
| }) | |
| } | |
| } |