Add Google Analytics

This commit is contained in:
Michael Jackson 2019-07-24 18:27:54 -07:00
parent ab83549744
commit ea35b3c4b0
1 changed files with 9 additions and 0 deletions

View File

@ -26,6 +26,15 @@ export default function MainTemplate({
e(
'head',
null,
// Global site tag (gtag.js) - Google Analytics
e('script', {
async: true,
src: 'https://www.googletagmanager.com/gtag/js?id=UA-140352188-1'
}),
x(`window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-140352188-1');`),
e('meta', { charSet: 'utf-8' }),
e('meta', { httpEquiv: 'X-UA-Compatible', content: 'IE=edge,chrome=1' }),
description && e('meta', { name: 'description', content: description }),