import type { Field } from 'payload' import { validateAnalyticsId } from '../../../modules/analytics/idFormats.js' /** * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only * after the matching consent category is granted (see modules/analytics). */ export const analyticsFields: Field[] = [ { name: 'ga4MeasurementId', type: 'text', admin: { description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)', placeholder: 'G-XXXXXXXXXX', }, validate: validateAnalyticsId('ga4MeasurementId', 'G-XXXXXXXXXX'), }, { name: 'gtmContainerId', type: 'text', admin: { description: 'Google Tag Manager container ID. (Google — Consent Mode)', placeholder: 'GTM-XXXXXXX', }, validate: validateAnalyticsId('gtmContainerId', 'GTM-XXXXXXX'), }, { name: 'metaPixelId', type: 'text', admin: { description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.', placeholder: '1234567890123456', }, validate: validateAnalyticsId('metaPixelId', '1234567890123456'), }, { name: 'clarityProjectId', type: 'text', admin: { description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.', placeholder: 'abcdefghij', }, validate: validateAnalyticsId('clarityProjectId', 'abcdefghij'), }, { name: 'linkedInPartnerId', type: 'text', admin: { description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.', placeholder: '1234567', }, validate: validateAnalyticsId('linkedInPartnerId', '1234567'), }, { name: 'tiktokPixelId', type: 'text', admin: { description: 'TikTok Pixel ID. Loads only after MARKETING consent.', placeholder: 'CXXXXXXXXXXXXXXXXXXX', }, validate: validateAnalyticsId('tiktokPixelId', 'CXXXXXXXXXXXXXXXXXXX'), }, ]