Update RetentionChart margin and add channel field to Clickhouse schema

- Adjusted the margin of the RetentionChart component for improved layout.
- Added a new 'channel' field to the Clickhouse schema to enhance data tracking capabilities.
- Integrated the 'channel' field into the pageviewQueue to capture additional context from page views.
This commit is contained in:
Bill Yang 2025-04-04 15:33:16 -07:00
parent c453578c4f
commit d7bd778bd6
5 changed files with 787 additions and 1 deletions

View file

@ -2,6 +2,7 @@ import { DateTime } from "luxon";
import clickhouse from "../db/clickhouse/clickhouse.js";
import { TrackingPayload } from "../types.js";
import { getDeviceType } from "../utils.js";
import { getChannel } from "./getChannel.js";
type TotalPayload = TrackingPayload & {
userId: string;
@ -78,6 +79,7 @@ class PageviewQueue {
querystring: pv.querystring || "",
page_title: pv.page_title || "",
referrer: pv.referrer || "",
channel: getChannel(pv.referrer, pv.querystring),
browser: pv.ua.browser.name || "",
browser_version: pv.ua.browser.major || "",
operating_system: pv.ua.os.name || "",