Add partytown settings for Google Analytics

This commit is contained in:
prototypa
2023-08-11 09:50:42 -04:00
parent 8dbdaf84d9
commit 03af96f664
4 changed files with 11 additions and 7 deletions

View File

@ -5,6 +5,6 @@ import { ANALYTICS_CONFIG } from '~/utils/config';
{
ANALYTICS_CONFIG?.vendors?.googleAnalytics?.id ? (
<GoogleAnalytics id={String(ANALYTICS_CONFIG.vendors.googleAnalytics.id)} partytown={true} />
<GoogleAnalytics id={String(ANALYTICS_CONFIG.vendors.googleAnalytics.id)} partytown={ANALYTICS_CONFIG?.vendors?.googleAnalytics?.partytown} />
) : null
}

View File

@ -2,7 +2,7 @@ import fs from 'fs';
import yaml from 'js-yaml';
import merge from 'lodash.merge';
import type { MetaSEO } from '~/types';
import type { MetaData } from '~/types';
export interface SiteConfig {
name: string;
@ -11,7 +11,7 @@ export interface SiteConfig {
trailingSlash?: boolean;
googleSiteVerificationId?: string;
}
export interface MetaDataConfig extends Omit<MetaSEO, 'title'> {
export interface MetaDataConfig extends Omit<MetaData, 'title'> {
title?: {
default: string;
template: string;
@ -61,8 +61,8 @@ export interface AppBlogConfig {
export interface AnalyticsConfig {
vendors: {
googleAnalytics: {
isEnabled?: boolean;
id?: string;
partytown?: boolean;
};
};
}
@ -187,8 +187,8 @@ const getAnalytics = () => {
const _default = {
vendors: {
googleAnalytics: {
isEnabled: false,
id: undefined,
partytown: true,
},
},
};