Skip to content

Commit

Permalink
merged master
Browse files Browse the repository at this point in the history
  • Loading branch information
okeino committed Oct 16, 2024
2 parents 730f9a0 + 232261f commit c351da7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/containers/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<P>({
Component,
Expand Down Expand Up @@ -76,7 +76,7 @@ function Base<P>({
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}');
`,
}}
/>
Expand Down
7 changes: 7 additions & 0 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -11,6 +13,11 @@ class MyDocument extends Document {
<body>
<Main />
<NextScript />
<noscript
dangerouslySetInnerHTML={{
__html: `<iframe src="https://www.googletagmanager.com/ns.html?id=${GTM_ID}" height="0" width="0" style="display: none; visibility: hidden;" />`,
}}
/>
</body>
</Html>
);
Expand Down

0 comments on commit c351da7

Please sign in to comment.