analytics
analytics copied to clipboard
Types for `@analytics/google-tag-manager`
Hello,
The analytics package has built-in TypeScript types. It would be great if its plugin packages, like @analytics/google-tag-manager, have type declarations as well.
I'm currently using this fallback:
declare module '@analytics/google-tag-manager' {
import type { AnalyticsPlugin } from 'analytics';
export interface GoogleTagManagerConfig {
auth?: string;
containerId: string;
customScriptSrc?: string;
dataLayerName?: string;
debug?: boolean;
execution?: string;
preview?: string;
}
function googleTagManager(config: GoogleTagManagerConfig): AnalyticsPlugin;
export default googleTagManager;
}
It might not be perfect, but it does help us for now.
@borasemiz I had this issue, and followed the advice in this thread: https://github.com/DavidWells/analytics/issues/99#issuecomment-736153120