Skip to content

Commit

Permalink
Merge pull request #99 from kogepanh/main
Browse files Browse the repository at this point in the history
#97 add g-analytics
  • Loading branch information
kogepanh authored Jul 30, 2021
2 parents 524663d + 2fb8e04 commit e0c4d63
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 e0c4d63

Please sign in to comment.