Skip to content

Commit

Permalink
Merge pull request #423 from mazipan/mazipan/revert-gtm
Browse files Browse the repository at this point in the history
revert: bring back gtm
  • Loading branch information
mazipan authored Jul 25, 2021
2 parents 55df148 + fd7d215 commit bdb65c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
20 changes: 20 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "typeface-inter";
import { useEffect } from "react";

import { LayoutRoot } from "~/components/layout/layout-root";
import { Script } from "~/components/script";
import config from "~/lib/config";

import type { AppProps } from "next/app";
Expand Down Expand Up @@ -82,6 +83,25 @@ export default function App({ Component, pageProps, router }: AppProps) {
<link href="/manifest.json" rel="manifest" />
<meta content="#1667C2" name="theme-color" />
</Head>

<Script
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l] = w[l] || [];w[l].push({'gtm.start':
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','GTM-5X4ZPBX');`,
}}
/>
<noscript>
<iframe
height="0"
src="https://www.googletagmanager.com/ns.html?id=GTM-5X4ZPBX"
style={{ display: "none", visibility: "hidden" }}
title="gtm"
width="0"
/>
</noscript>
<Component {...pageProps} />
</LayoutRoot>
);
Expand Down
19 changes: 0 additions & 19 deletions pages/home-page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Page } from "~/components/layout/page";
import { PageContent } from "~/components/layout/page-content";
import { Script } from "~/components/script";
import data from "~/data/wbw.json";
import { bannerBlurData, cloudinaryLoader } from "~/lib/cloudinary-loader";
import config from "~/lib/config";
Expand Down Expand Up @@ -36,24 +35,6 @@ export default function Home(props: HomeProps) {
<Head>
<style dangerouslySetInnerHTML={{ __html: props.css }} />
</Head>
<Script
dangerouslySetInnerHTML={{
__html: `(function(w,d,s,l,i){w[l] = w[l] || [];w[l].push({'gtm.start':
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','GTM-5X4ZPBX');`,
}}
/>
<noscript>
<iframe
height="0"
src="https://www.googletagmanager.com/ns.html?id=GTM-5X4ZPBX"
style={{ display: "none", visibility: "hidden" }}
title="gtm"
width="0"
/>
</noscript>
<header>
<div className="max-w-xl mx-auto">
<h1 className="p-0">
Expand Down

0 comments on commit bdb65c3

Please sign in to comment.