Skip to content

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

📈 Automatically set poll group name (#1900)

Luke Vellaf6451b4fec3f
diff --git a/apps/web/src/features/analytics/service.ts b/apps/web/src/features/analytics/service.ts
index 8f10c2c93..891d35285 100644
--- a/apps/web/src/features/analytics/service.ts
+++ b/apps/web/src/features/analytics/service.ts
@@ -34,7 +34,6 @@ export class AnalyticsService {
case "poll_create":
// Set up initial group properties for new polls
this.setPoll(event.pollId, {
- name: event.properties.title, // The PostHog UI identifies a group using the name property
title: event.properties.title,
status: "live", // New polls start as live
participant_count: 0, // New polls start with 0 participants
@@ -102,15 +101,14 @@ export class AnalyticsService {
setPoll(pollId: string, properties: Partial<PollGroupProperties>): void {
if (!this.posthog) return;
- try {
- this.posthog.groupIdentify({
- groupType: "poll",
- groupKey: pollId,
- properties,
- });
- } catch (error) {
- console.error("Failed to update poll group:", error);
- }
+ this.posthog.groupIdentify({
+ groupType: "poll",
+ groupKey: pollId,
+ properties: {
+ ...properties,
+ name: properties.title,
+ },
+ });
}
/**