summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-09-17 10:42:24 -0700
committerGravatar Fred K. Schott <fkschott@gmail.com> 2021-09-17 10:42:24 -0700
commit6975792e5cfde9e2e31d83fbf930484fc9477643 (patch)
treeab9f6777a2331f756b17d27d5987cf0798a8265e
parent4613d9bc4c3e8c5d4a50163663cb5103fc79bc93 (diff)
downloadastro-6975792e5cfde9e2e31d83fbf930484fc9477643.tar.gz
astro-6975792e5cfde9e2e31d83fbf930484fc9477643.tar.zst
astro-6975792e5cfde9e2e31d83fbf930484fc9477643.zip
add analytics back to blog posts
Diffstat (limited to '')
-rw-r--r--www/src/components/BlogPost.astro2
-rw-r--r--www/src/pages/blog/introducing-astro.astro9
-rw-r--r--www/src/pages/index.astro12
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>