Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📈 Track poll settings

Luke Vella41781f991c74
diff --git a/apps/web/src/features/analytics/service.ts b/apps/web/src/features/analytics/service.ts
index 891d35285..1efb9e177 100644
--- a/apps/web/src/features/analytics/service.ts
+++ b/apps/web/src/features/analytics/service.ts
@@ -34,14 +34,10 @@ export class AnalyticsService {
case "poll_create":
// Set up initial group properties for new polls
this.setPoll(event.pollId, {
- title: event.properties.title,
status: "live", // New polls start as live
participant_count: 0, // New polls start with 0 participants
comment_count: 0, // New polls start with 0 comments
- option_count: event.properties.optionCount,
- has_location: event.properties.hasLocation,
- has_description: event.properties.hasDescription,
- timezone: event.properties.timezone,
+ ...toSnakeCaseKeys(event.properties),
});
break;
@@ -101,12 +97,14 @@ export class AnalyticsService {
setPoll(pollId: string, properties: Partial<PollGroupProperties>): void {
if (!this.posthog) return;
+ const { title, ...forwardProps } = properties;
+
this.posthog.groupIdentify({
groupType: "poll",
groupKey: pollId,
properties: {
- ...properties,
- name: properties.title,
+ name: title,
+ ...forwardProps,
},
});
}
diff --git a/apps/web/src/features/poll/analytics.ts b/apps/web/src/features/poll/analytics.ts
index df64e2b7f..14b3d6a93 100644
--- a/apps/web/src/features/poll/analytics.ts
+++ b/apps/web/src/features/poll/analytics.ts
@@ -53,6 +53,10 @@ export interface PollCreateEvent extends BaseEventData {
hasLocation: boolean;
hasDescription: boolean;
timezone?: string;
+ disableCommnets: boolean;
+ hideScores: boolean;
+ hideParticipants: boolean;
+ requireParticipantEmail: boolean;
};
}
diff --git a/apps/web/src/trpc/routers/polls.ts b/apps/web/src/trpc/routers/polls.ts
index c4c9e18f0..97706d98e 100644
--- a/apps/web/src/trpc/routers/polls.ts
+++ b/apps/web/src/trpc/routers/polls.ts
@@ -227,10 +227,7 @@ export const polls = router({
}
const poll = await prisma.poll.create({
- select: {
- adminUrlId: true,
- id: true,
- title: true,
+ include: {
options: {
select: {
id: true,
@@ -311,6 +308,10 @@ export const polls = router({
hasLocation: !!input.location,
hasDescription: !!input.description,
timezone: input.timeZone,
+ disableCommnets: poll.disableComments,
+ hideParticipants: poll.hideParticipants,
+ hideScores: poll.hideScores,
+ requireParticipantEmail: poll.requireParticipantEmail,
},
});