MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / pickUtm

Function pickUtm

packages/db/src/buffers/session-buffer.ts:62–70  ·  view source on GitHub ↗
(
  payload: IServiceCreateEventPayload,
  key: 'utm_medium' | 'utm_source' | 'utm_campaign' | 'utm_content' | 'utm_term'
)

Source from the content-addressed store, hash-verified

60}
61
62function pickUtm(
63 payload: IServiceCreateEventPayload,
64 key: 'utm_medium' | 'utm_source' | 'utm_campaign' | 'utm_content' | 'utm_term'
65): string {
66 const query = (payload.properties as { __query?: Record<string, unknown> } | undefined)
67 ?.__query;
68 const v = query?.[key];
69 return v ? String(v) : '';
70}
71
72export class SessionBuffer extends BaseBuffer {
73 private batchSize = process.env.SESSION_BUFFER_BATCH_SIZE

Callers 1

newSessionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected