build
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m30s
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m30s
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import type { AnalyticsEventProperties, AnalyticsService } from './analytics-service';
|
||||
import { getServerAppServices } from '../create-services.server';
|
||||
|
||||
/**
|
||||
* Type definition for the Umami global object.
|
||||
@@ -75,6 +74,7 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
|
||||
// Server-side tracking via proxy
|
||||
if (typeof window === 'undefined') {
|
||||
const { getServerAppServices } = require('../create-services.server');
|
||||
const websiteId = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID;
|
||||
const umamiUrl = process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL?.replace('/script.js', '') || 'https://analytics.infra.mintel.me';
|
||||
|
||||
@@ -122,6 +122,7 @@ export class UmamiAnalyticsService implements AnalyticsService {
|
||||
|
||||
// Server-side tracking via proxy
|
||||
if (typeof window === 'undefined') {
|
||||
const { getServerAppServices } = require('../create-services.server');
|
||||
const websiteId = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID;
|
||||
const umamiUrl = process.env.NEXT_PUBLIC_UMAMI_SCRIPT_URL?.replace('/script.js', '') || 'https://analytics.infra.mintel.me';
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'server-only';
|
||||
|
||||
import { AppServices } from './app-services';
|
||||
import { NoopAnalyticsService } from './analytics/noop-analytics-service';
|
||||
import { UmamiAnalyticsService } from './analytics/umami-analytics-service';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { AppServices } from './app-services';
|
||||
import { NoopAnalyticsService } from './analytics/noop-analytics-service';
|
||||
import { UmamiAnalyticsService } from './analytics/umami-analytics-service';
|
||||
import { MemoryCacheService } from './cache/memory-cache-service';
|
||||
import { GlitchtipErrorReportingService } from './errors/glitchtip-error-reporting-service';
|
||||
import { NoopErrorReportingService } from './errors/noop-error-reporting-service';
|
||||
@@ -75,8 +74,12 @@ export function getAppServices(): AppServices {
|
||||
const sentryServerEnabled = Boolean(process.env.SENTRY_DSN);
|
||||
|
||||
// Create analytics service (Umami or no-op)
|
||||
// Use dynamic import to avoid importing server-only code in client components
|
||||
const analytics = umamiEnabled
|
||||
? new UmamiAnalyticsService({ enabled: true })
|
||||
? (() => {
|
||||
const { UmamiAnalyticsService } = require('./analytics/umami-analytics-service');
|
||||
return new UmamiAnalyticsService({ enabled: true });
|
||||
})()
|
||||
: new NoopAnalyticsService();
|
||||
|
||||
// Create error reporting service (GlitchTip/Sentry or no-op)
|
||||
|
||||
Reference in New Issue
Block a user