@omniconvert/server-side-testing-sdk
Version:
TypeScript SDK for server-side A/B testing and experimentation
56 lines • 1.38 kB
TypeScript
/**
* Google Analytics 4 cookie reader utility
* Extracts GA4 tracking and session IDs from browser cookies
*/
export declare class Ga4CookieReader {
private static readonly GA4_COOKIE_PREFIX;
private static readonly GA4_MAIN_COOKIE;
/**
* Read GA4 tracking ID from cookies
*/
static readTrackingId(): string;
/**
* Read GA4 session ID from cookies
*/
static readSessionId(): string;
/**
* Get all GA4 property cookies
*/
private static getGA4PropertyCookies;
/**
* Extract tracking ID from GA4 property cookie
*/
private static extractTrackingIdFromPropertyCookie;
/**
* Extract session ID from GA4 property cookie
*/
private static extractSessionIdFromPropertyCookie;
/**
* Get a specific cookie value
*/
private static getCookie;
/**
* Get all GA4 related information
*/
static getGA4Info(): GA4Info;
/**
* Check if GA4 is present on the page
*/
static isGA4Present(): boolean;
/**
* Get GA4 measurement ID from cookie name
*/
static getMeasurementIds(): string[];
}
/**
* GA4 information interface
*/
export interface GA4Info {
trackingId: string;
sessionId: string;
cookies: Array<{
name: string;
value: string;
}>;
}
//# sourceMappingURL=Ga4CookieReader.d.ts.map