Merge pull request #35 from lirantal/feat/splitbee-analytics

feat: add out of the box support for Splitbee Analytics
This commit is contained in:
widgeter
2022-10-22 09:49:39 +02:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import defaultImageSrc from '~/assets/images/default.png';
import { SITE } from '~/config.mjs';
import Fonts from '../atoms/Fonts.astro';
import ExtraMetaTags from '../atoms/ExtraMetaTags.astro';
import SplitbeeAnalytics from "./SplitbeeAnalytics.astro";
const { src: defaultImage } = await getImage({
src: defaultImageSrc,
@ -76,4 +77,6 @@ const image =
<!-- Google Analytics -->
{SITE.googleAnalyticsId && <GoogleAnalytics id={String(SITE.googleAnalyticsId)} partytown={true} />}
{SITE.splitbeeAnalytics?.enabled && <SplitbeeAnalytics {...SITE.splitbeeAnalytics} />}
<ExtraMetaTags />

View File

@ -0,0 +1,15 @@
---
const {
doNotTrack = true,
noCookieMode = false,
url = "https://cdn.splitbee.io/sb.js"
} = Astro.props;
---
<!-- Splitbee Analytics -->
<script
data-respect-dnt={doNotTrack}
data-no-cookie={noCookieMode}
async
src={url}
></script>