/** * Append UTM tracking params to an outbound URL. * * Preserves an existing `#anchor` fragment and existing query string, so a * value like `https://app.com/x?ref=abc#sec` stays well-formed after tagging. * * withUtm('https://x.com/a?ref=abc#sec', { source: 'whatsapp', campaign: 'devo' }) * → 'https://x.com/a?ref=abc&utm_source=whatsapp&utm_medium=chat&utm_campaign=devo#sec' * * Defaults: medium = 'chat' (this is a chat-channel framework). Source has no * default — it's the identifier that downstream analytics group by, so the * caller must specify it. * * `createUtmTagger` returns a partially-applied tagger when the source/medium * stay constant across calls (the usual case for a single bot): * * const tagWa = createUtmTagger({ source: 'whatsapp' }); * tagWa('https://x.com/a', 'devo') // → '...utm_source=whatsapp&utm_medium=chat&utm_campaign=devo' */ export interface UtmParams { source: string; campaign: string; medium?: string; term?: string; content?: string; } export declare function withUtm(url: string, params: UtmParams): string; export interface UtmTaggerDefaults { source: string; medium?: string; term?: string; content?: string; } export type UtmTagger = (url: string, campaign: string, overrides?: Partial) => string; export declare function createUtmTagger(defaults: UtmTaggerDefaults): UtmTagger; //# sourceMappingURL=utm.d.ts.map