mirror of
https://github.com/ritz078/transform.git
synced 2026-12-02 05:12:15 +03:00
remove duplicate google tag manager (#122)
This commit is contained in:
1 parent
0ca0d17ead
commit
c89ab5ff4a
1 file changed
-24
@@ -7,22 +7,6 @@ interface DocumentProps {
|
||||
hydrationScript: React.ReactChild;
|
||||
}
|
||||
|
||||
function trackingScript() {
|
||||
// @ts-ignore
|
||||
if (window.dataLayer) return;
|
||||
// @ts-ignore
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
// @ts-ignore
|
||||
window.dataLayer.push(arguments);
|
||||
}
|
||||
// @ts-ignore
|
||||
gtag("js", new Date());
|
||||
|
||||
// @ts-ignore
|
||||
gtag("config", "UA-60624235-8");
|
||||
}
|
||||
|
||||
export default class MyDocument extends Document<DocumentProps> {
|
||||
static getInitialProps({ renderPage }) {
|
||||
const page = renderPage();
|
||||
@@ -54,14 +38,6 @@ export default class MyDocument extends Document<DocumentProps> {
|
||||
<Main />
|
||||
{hydrationScript}
|
||||
<NextScript />
|
||||
|
||||
<script
|
||||
async
|
||||
src="https://www.googletagmanager.com/gtag/js?id=UA-60624235-8"
|
||||
/>
|
||||
<script>
|
||||
<>{IN_BROWSER && trackingScript()}</>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user