From b6d848b10c44529c8098feb9d3d28b0d9ea01a5a Mon Sep 17 00:00:00 2001 From: Henry Orozco Date: Tue, 15 Oct 2024 16:40:19 -0600 Subject: [PATCH] fix: GTM --- src/containers/base.tsx | 4 ++-- src/pages/_document.tsx | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/containers/base.tsx b/src/containers/base.tsx index 17957b834..28e48e39d 100644 --- a/src/containers/base.tsx +++ b/src/containers/base.tsx @@ -28,7 +28,7 @@ export interface IBaseProps { const queryClient = makeQueryClient(); -export const GA_TRACKING_ID = 'GTM-5HNWR6'; +export const GTM_ID = 'GTM-5HNWR6'; function Base

({ Component, @@ -76,7 +76,7 @@ function Base

({ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); - })(window,document,'script','dataLayer', '${GA_TRACKING_ID}'); + })(window,document,'script','dataLayer', '${GTM_ID}'); `, }} /> diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 1ea7d6e2c..fd02fecc4 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,6 +1,8 @@ import Document, { Head, Html, Main, NextScript } from 'next/document'; import React from 'react'; +import { GTM_ID } from '~src/containers/base'; + class MyDocument extends Document { render() { return ( @@ -11,6 +13,11 @@ class MyDocument extends Document {

+