diff options
Diffstat (limited to '')
-rw-r--r-- | www/src/components/BlogPost.astro | 2 | ||||
-rw-r--r-- | www/src/pages/blog/introducing-astro.astro | 9 | ||||
-rw-r--r-- | www/src/pages/index.astro | 12 |
3 files changed, 4 insertions, 19 deletions
diff --git a/www/src/components/BlogPost.astro b/www/src/components/BlogPost.astro index 8b5221362..c2cd18587 100644 --- a/www/src/components/BlogPost.astro +++ b/www/src/components/BlogPost.astro @@ -1,6 +1,7 @@ --- import Author from './Author.astro'; import GithubStarButton from './GithubStarButton.astro'; +import GoogleAnalytics from './GoogleAnalytics.astro'; export interface Props { title: string; @@ -25,6 +26,7 @@ const { title, author, publishDate, heroImage } = Astro.props; <slot /> </main> </article> + <GoogleAnalytics /> </div> <style lang="scss"> diff --git a/www/src/pages/blog/introducing-astro.astro b/www/src/pages/blog/introducing-astro.astro index 3f7e13f4c..e74b784a4 100644 --- a/www/src/pages/blog/introducing-astro.astro +++ b/www/src/pages/blog/introducing-astro.astro @@ -115,15 +115,6 @@ npm run dev </Note> </Markdown> </BlogPost> - - <!-- Global site tag (gtag.js) - Google Analytics --> - <script async src="https://www.googletagmanager.com/gtag/js?id=UA-130280175-15"></script> - <script> - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', 'UA-130280175-15'); - </script> </body> </html> diff --git a/www/src/pages/index.astro b/www/src/pages/index.astro index 5c7a8d5e9..d0897cb0b 100644 --- a/www/src/pages/index.astro +++ b/www/src/pages/index.astro @@ -2,11 +2,11 @@ import BaseHead from '../components/BaseHead.astro'; import Space from '../components/Space.astro'; import Main from '../components/Main.astro'; -import Logo from '../components/Logo.astro'; import Article from '../components/Article.astro'; import Tagline from '../components/Tagline.astro'; import MainHeader from '../components/MainHeader.astro'; import Sponsors from '../components/Sponsors.astro'; +import GoogleAnalytics from '../components/GoogleAnalytics.astro'; import YouTube from '../components/YouTube.astro'; import "../components/YouTube.css"; @@ -104,14 +104,6 @@ let lang = 'en'; <script> console.log('%cGet early Astro access 👉 https://astro.build/chat', "color:#17c083; font-size: 1.2em; padding: 1em;"); </script> - - <!-- Global site tag (gtag.js) - Google Analytics --> - <script async src="https://www.googletagmanager.com/gtag/js?id=UA-130280175-15"></script> - <script> - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', 'UA-130280175-15'); - </script> + <GoogleAnalytics /> </body> </html> |