Merge pull request #35 from lirantal/feat/splitbee-analytics
feat: add out of the box support for Splitbee Analytics
This commit is contained in:
@ -9,6 +9,7 @@ import defaultImageSrc from '~/assets/images/default.png';
|
|||||||
import { SITE } from '~/config.mjs';
|
import { SITE } from '~/config.mjs';
|
||||||
import Fonts from '../atoms/Fonts.astro';
|
import Fonts from '../atoms/Fonts.astro';
|
||||||
import ExtraMetaTags from '../atoms/ExtraMetaTags.astro';
|
import ExtraMetaTags from '../atoms/ExtraMetaTags.astro';
|
||||||
|
import SplitbeeAnalytics from "./SplitbeeAnalytics.astro";
|
||||||
|
|
||||||
const { src: defaultImage } = await getImage({
|
const { src: defaultImage } = await getImage({
|
||||||
src: defaultImageSrc,
|
src: defaultImageSrc,
|
||||||
@ -76,4 +77,6 @@ const image =
|
|||||||
<!-- Google Analytics -->
|
<!-- Google Analytics -->
|
||||||
{SITE.googleAnalyticsId && <GoogleAnalytics id={String(SITE.googleAnalyticsId)} partytown={true} />}
|
{SITE.googleAnalyticsId && <GoogleAnalytics id={String(SITE.googleAnalyticsId)} partytown={true} />}
|
||||||
|
|
||||||
|
{SITE.splitbeeAnalytics?.enabled && <SplitbeeAnalytics {...SITE.splitbeeAnalytics} />}
|
||||||
|
|
||||||
<ExtraMetaTags />
|
<ExtraMetaTags />
|
||||||
|
15
src/components/core/SplitbeeAnalytics.astro
Normal file
15
src/components/core/SplitbeeAnalytics.astro
Normal 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>
|
Reference in New Issue
Block a user