/** * Google Analytics 4 in the storefront page head: the script that * `modules/base/pages/frontStore/all/GoogleAnalyticsHead.tsx` (a `head` area * component) renders, only when the store has a valid Measurement ID * (setting `gaMeasurementId`): a store without one loads and runs nothing. * * One inline script, in the order Google's Consent Mode needs: `dataLayer` * and `gtag()`, the consent default (setting `gaConsentDefault`), `config` * (which sends the page view), then the gtag.js loader. `gtag()` exists * before the page bundle, whose listener * (`modules/base/pages/frontStore/all/GoogleAnalytics.tsx`) sends the * commerce events. */ export declare const GA4_MEASUREMENT_ID_PATTERN: RegExp; /** * granted: no consent command, so GA4 collects from the first page. denied: * analytics and ads storage stay denied until a cookie banner sends Google's * consent update. Google still receives cookieless pings before that * (Google's advanced consent mode). */ export type GaConsentDefault = 'granted' | 'denied'; export declare const isGa4MeasurementId: (value: unknown) => value is string; /** * The stored setting as a consent default: 'denied' in any case or with * spaces around it (a value saved through the API or by SQL) is 'denied', * anything else 'granted' */ export declare const toGaConsentDefault: (value: unknown) => GaConsentDefault; /** * The head script, or '' without a valid Measurement ID. The id is written * into the script: the pattern allows letters, digits and the dash only. */ export declare function googleAnalyticsHeadScript(measurementId: unknown, consentDefault: unknown): string;