15 lines
601 B
JavaScript
15 lines
601 B
JavaScript
import { getSiteIntegrations } from '../payload/index.js';
|
|
/**
|
|
* Reads the public analytics IDs from SiteIntegrations, server-side.
|
|
*
|
|
* Returns only the two public IDs (GA4 / GTM) — safe to pass to the client
|
|
* <Analytics> component. Does NOT expose any secret from SiteIntegrations.
|
|
*/ export async function getAnalyticsConfig(payload) {
|
|
const integrations = await getSiteIntegrations(payload);
|
|
return {
|
|
ga4MeasurementId: integrations.ga4MeasurementId ?? null,
|
|
gtmContainerId: integrations.gtmContainerId ?? null
|
|
};
|
|
}
|
|
|
|
//# sourceMappingURL=getAnalyticsConfig.js.map
|