import type { ServiceAdapter } from '../core/service-adapter.js'; import type { BaseAdapterOptions } from './shared.js'; /** * Matomo/Piwik analytics adapter. * * @see https://developer.matomo.org/guides/tracking-consent * * Documented _paq commands (from Matomo docs): * - `_paq.push(['requireConsent'])` — block all tracking until consent * - `_paq.push(['requireCookieConsent'])` — allow cookieless tracking, block cookies * - `_paq.push(['setConsentGiven'])` / `_paq.push(['setCookieConsentGiven'])` — grant (external persistence) * - `_paq.push(['rememberConsentGiven'])` / `_paq.push(['rememberCookieConsentGiven'])` — grant (Matomo persistence) * - `_paq.push(['forgetConsentGiven'])` / `_paq.push(['forgetCookieConsentGiven'])` — revoke * * Matomo should be initialized with `requireConsent` or `requireCookieConsent`: * * ```js * _paq.push(['requireConsent']); // blocks all tracking * // or * _paq.push(['requireCookieConsent']); // allows cookieless tracking * ``` * * Then register the adapter: * * ```js * registry.register(createMatomoAdapter()); * ``` */ /** The Matomo _paq command queue. */ export type MatomoPaq = Array; export interface MatomoAdapterOptions extends BaseAdapterOptions { /** * Consent mode: * - 'tracking' — blocks all requests until consent (requireConsent) * - 'cookie' — allows cookieless requests, blocks cookies (requireCookieConsent) * Default: 'tracking' */ mode?: 'tracking' | 'cookie'; /** * If true, Matomo stores consent in its own cookie via * rememberConsentGiven / rememberCookieConsentGiven. * Default: false (Keksmeister manages persistence) */ rememberInMatomo?: boolean; } /** * Create a Matomo service adapter. * * @param paq - The Matomo _paq array (default: window._paq) * @param options - Optional configuration */ export declare function createMatomoAdapter(paq?: MatomoPaq, options?: MatomoAdapterOptions): ServiceAdapter;