Merge pull request #11 from Taraskin/astro-analytics

Added Google Analytics 4 snippet injection by using '@julian_cataldo/…
This commit is contained in:
prototypa
2022-08-28 18:59:32 -04:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,7 @@
"@astrojs/rss": "^1.0.0",
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^1.0.0",
"@julian_cataldo/astro-analytics": "^0.11.5",
"@tailwindcss/typography": "^0.5.4",
"astro": "^1.0.0",
"astro-icon": "^0.7.3",

View File

@ -1,10 +1,14 @@
---
import { SITE } from "~/config.mjs"
import "~/assets/styles/base.css";
import MetaTags from "~/components/core/MetaTags.astro";
import BasicScripts from "~/components/core/BasicScripts.astro";
import Analytics from '@julian_cataldo/astro-analytics/Analytics.astro';
const { meta = {} } = Astro.props;
const { googleAnalyticsId = false } = SITE;
---
<!DOCTYPE html>
@ -12,6 +16,7 @@ const { meta = {} } = Astro.props;
<head>
<MetaTags {...meta} />
{googleAnalyticsId && <Analytics id={googleAnalyticsId} />}
</head>
<body class="antialiased text-gray-900 dark:text-slate-300 tracking-tight bg-white dark:bg-slate-900">