-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revert: bring back gtm #423
Changes from 5 commits
9ce77ee
a6be07e
c9b9078
9ed3e03
f26ac28
8342360
fd7d215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"; | ||
|
@@ -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" | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to add </iframe> instead for the noscript to work properly. See previous implementation here: https://github.com/kawalcovid19/wargabantuwarga.com/pull/36/files?file-filters%5B%5D=.tsx There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bisa insert expectation kode komplit nya dari GTM gak ya, Mas @baraeb92.? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since all these codes are just copy-paste from previous implementation without any modifications There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
</noscript> | ||
<Component {...pageProps} /> | ||
</LayoutRoot> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line 86 could be removed I think