@shopana/ga
Version:
Type-safe Google Analytics 4 (GA4) tracking library for React and Next.js with ecommerce support, event batching, and SSR compatibility
31 lines • 1.23 kB
TypeScript
import { type GAPlatformAdapter } from '../types/platform';
import { type AnalyticsStateSnapshot, type EventPayload, type FlushOptions, type GA4Config, type TrackOptions } from '../types/common';
import { DebugChannel } from '../utils/debugChannel';
import { type AnalyticsClientOptions } from '../types/core';
export declare class AnalyticsClient {
private readonly adapter;
private config;
private readonly hooks;
private readonly logger;
private readonly debugChannel;
private batchSize;
private batchTimeoutMs;
private retryStrategy;
private readonly state;
private readonly eventQueue;
private initPromise?;
constructor(adapter: GAPlatformAdapter, config: GA4Config, options?: AnalyticsClientOptions);
getDebugChannel(): DebugChannel;
getState(): AnalyticsStateSnapshot;
updateConfig(patch: Partial<GA4Config>): void;
init(): Promise<void>;
track(payload: EventPayload, options?: TrackOptions): Promise<void>;
flush(options?: FlushOptions): Promise<void>;
destroy(): void;
private enqueue;
private isBatchingEnabled;
private sendWithRetry;
private handleError;
private assertCanTrack;
}
//# sourceMappingURL=AnalyticsClient.d.ts.map