Merge pull request #11 from Taraskin/astro-analytics
Added Google Analytics 4 snippet injection by using '@julian_cataldo/…
This commit is contained in:
@ -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",
|
||||
|
@ -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">
|
||||
|
Reference in New Issue
Block a user