Skip to content

Commit

Permalink
#97 add g-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
kogepanh committed Jul 30, 2021
1 parent 15c4e3b commit 2fb8e04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ export default {
src: 'https://www.googletagmanager.com/gtag/js?id=G-NDLRBPBQJZ',
},
{
innerHTML: `window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-NDLRBPBQJZ');`,
src: '/static/gtag.js',
},
],
__dangerouslyDisableSanitizers: ['script'],
link: [
{
rel: 'stylesheet',
Expand Down
9 changes: 9 additions & 0 deletions static/gtag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
window.dataLayer = window.dataLayer || []

function gtag() {
dataLayer.push(arguments)
}

gtag('js', new Date())

gtag('config', 'G-NDLRBPBQJZ')

0 comments on commit 2fb8e04

Please sign in to comment.