Skip to content

Commit

Permalink
fix: gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
edmon1024 committed Apr 10, 2020
1 parent 858bebc commit 98d76bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
5 changes: 1 addition & 4 deletions src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/core/styles';
import theme from '../theme/theme';
import { gtag1, gtag2 } from '../services/gtag'
import { gtag1 } from '../services/gtag'
import { tagManagerHead, tagManagerBody } from '../services/tagManager'

export default class MyDocument extends Document {
Expand All @@ -25,10 +25,7 @@ export default class MyDocument extends Document {
<link rel="manifest" href="/manifest.json" />
<link href="https://api.mapbox.com/mapbox-gl-js/v1.8.1/mapbox-gl.css" rel="stylesheet" />

{gtag2()}
{gtag1()}


{tagManagerHead()}
</Head>
<body>
Expand Down
4 changes: 0 additions & 4 deletions src/services/gtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ export function gtag1(){
/>
)
}

export function gtag2(){
return( <script async src={`https://www.googletagmanager.com/gtag/js?id=${process.env.GA_TRACKING_ID}`} /> )
}

0 comments on commit 98d76bb

Please sign in to comment.