serwist
Version:
A Swiss Army knife for service workers.
30 lines • 1.21 kB
TypeScript
import type { Serwist } from "../../Serwist.js";
export interface GoogleAnalyticsInitializeOptions {
serwist: Serwist;
/**
* The cache name to store and retrieve analytics.js. Defaults to Serwist's default cache names.
*/
cacheName?: string;
/**
* [Measurement Protocol parameters](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters),
* expressed as key/value pairs, to be added to replayed Google Analytics
* requests. This can be used to, e.g., set a custom dimension indicating
* that the request was replayed.
*/
parameterOverrides?: {
[paramName: string]: string;
};
/**
* A function that allows you to modify the hit parameters prior to replaying
* the hit. The function is invoked with the original hit's URLSearchParams
* object as its only argument.
*/
hitFilter?: (params: URLSearchParams) => void;
}
/**
* Initialize Serwist's offline Google Analytics v3 support.
*
* @param options
*/
export declare const initializeGoogleAnalytics: ({ serwist, cacheName, ...options }: GoogleAnalyticsInitializeOptions) => void;
//# sourceMappingURL=initializeGoogleAnalytics.d.ts.map