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 />
|
||||||
|
6
src/components/core/SplitbeeAnalytics.astro
Normal file
6
src/components/core/SplitbeeAnalytics.astro
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<!-- Splitbee Analytics -->
|
||||||
|
<script
|
||||||
|
data-respect-dnt={Astro.props.doNotTrack}
|
||||||
|
data-no-cookie={Astro.props.noCookieMode}
|
||||||
|
async src="https://cdn.splitbee.io/sb.js">
|
||||||
|
</script>
|
@ -9,6 +9,12 @@ export const SITE = {
|
|||||||
|
|
||||||
googleAnalyticsId: false, // or "G-XXXXXXXXXX",
|
googleAnalyticsId: false, // or "G-XXXXXXXXXX",
|
||||||
googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M',
|
googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M',
|
||||||
|
|
||||||
|
splitbeeAnalytics: {
|
||||||
|
enabled: false,
|
||||||
|
doNotTrack: true,
|
||||||
|
noCookieMode: false,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const BLOG = {
|
export const BLOG = {
|
||||||
|
Reference in New Issue
Block a user