From 187095908d184b0bdc213e6caf9b66e4291d25bb Mon Sep 17 00:00:00 2001 From: felipefialho Date: Thu, 19 Oct 2023 18:15:49 -0300 Subject: [PATCH] feat: add gtm --- src/index.pug | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/index.pug b/src/index.pug index c72f8898..7d0df658 100644 --- a/src/index.pug +++ b/src/index.pug @@ -2,7 +2,13 @@ doctype html html(lang='en') - head + head + script. + (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': + new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], + j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= + 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); + })(window,document,'script','dataLayer','GTM-TZDLZX82'); title #{data.title} - #{data.description} meta(charset='utf-8') meta(name='description' content=data.description) @@ -27,17 +33,13 @@ html(lang='en') meta(name='viewport' content='width=device-width, initial-scale=1, maximum-scale=5') meta(name='theme-color' content=data.theme_color) link(rel='shortcut icon' type='image/favicon' href='favicon.ico') - script(async src='https://www.googletagmanager.com/gtag/js?id=' + data.ga) - script. - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', '#{data.ga}'); style. body { visibility: hidden; } - body + body + noscript + iframe(src='https://www.googletagmanager.com/ns.html?id=GTM-TZDLZX82' height='0' width='0' style='display:none;visibility:hidden') section.header .piano .piano-key