mr-gtag
Version:
Easy, strong typed, and a modern way to use google analytics gtag lib.
32 lines (31 loc) • 1.25 kB
TypeScript
export interface GtagConfigOptions {
send_page_view?: boolean;
transport_type?: 'beacon' | 'xhr' | 'image';
groups?: string;
[prop: string]: any;
}
/**
* Only injects the google analytics gtag lib without calling config.
* @param trackingId The ga tracking id.
*/
export declare function onlyInstallGtag(trackingId: string): void;
/**
* Injects the google analytics gtag lib.
* @param trackingId The ga tracking id.
* @param options The options to configure.
*/
export declare function installGtag(trackingId: string, options?: GtagConfigOptions): void;
export declare function gtagRaw(...params: any[]): void;
export declare function gtag(command: 'config', trackingId: string, options?: GtagConfigOptions): void;
export declare function gtag(command: 'set', options: any): void;
export declare function gtag(command: 'event', action: 'page_view', options?: {
page_title?: string;
page_location?: string;
page_path?: string;
send_to?: string;
}): void;
export declare function gtag(command: 'event', action: 'exception', options?: {
description?: string;
fatal?: boolean;
}): void;
export declare function gtag(command: 'event', action: string, options?: any): void;