Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
π Track attribution surfaces before gating removal behind Pro (#2794)
Luke Vella5489d11665f6
diff --git a/apps/web/src/features/poll/components/new-participant-modal.tsx b/apps/web/src/features/poll/components/new-participant-modal.tsxindex 217a86a72..e60a8b899 100644--- a/apps/web/src/features/poll/components/new-participant-modal.tsx+++ b/apps/web/src/features/poll/components/new-participant-modal.tsx@@ -242,6 +242,15 @@ export const NewParticipantForm = (props: NewParticipantModalProps) => {pollId: poll.id,timeZone,});+ posthog?.capture("new_participant_dialog:success_view", {+ pollId: poll.id,+ spaceId: poll.spaceId,+ tier: poll.space?.tier,+ $groups: {+ poll: poll.id,+ ...(poll.spaceId ? { space: poll.spaceId } : {}),+ },+ });props.onSubmit?.(newParticipant);} catch (error) {if (error instanceof TRPCClientError) {diff --git a/apps/web/src/features/poll/components/poll-footer.tsx b/apps/web/src/features/poll/components/poll-footer.tsxindex 67f3e1150..3d85d3fe8 100644--- a/apps/web/src/features/poll/components/poll-footer.tsx+++ b/apps/web/src/features/poll/components/poll-footer.tsx@@ -1,10 +1,13 @@"use client";+import { posthog } from "@rallly/posthog/client";import Link from "next/link";import { useBranding } from "@/features/branding/client";+import { usePoll } from "@/features/poll/client";import { Trans } from "@/i18n/client";export function PollFooter() {const { hideAttribution } = useBranding();+ const poll = usePoll();if (hideAttribution) {return null;@@ -21,7 +24,18 @@ export function PollFooter() {<Linkprefetch={false}className="rounded-none border-b border-b-gray-500 font-semibold hover:text-primary"- href="https://rallly.co"+ href="https://rallly.co?utm_source=rallly&utm_medium=poll&utm_campaign=powered_by"+ onClick={() => {+ posthog?.capture("poll_footer:powered_by_link_click", {+ pollId: poll.id,+ spaceId: poll.spaceId,+ tier: poll.space?.tier,+ $groups: {+ poll: poll.id,+ ...(poll.spaceId ? { space: poll.spaceId } : {}),+ },+ });+ }}/>),}}diff --git a/apps/web/src/lib/posthog.ts b/apps/web/src/lib/posthog.tsindex b8f4f238d..a982f941c 100644--- a/apps/web/src/lib/posthog.ts+++ b/apps/web/src/lib/posthog.ts@@ -29,8 +29,10 @@ export function posthog() {* noRestrictedImports in apps/web/biome.json) so the guest decision cannot* be forgotten at individual capture sites. Guests are captured as anonymous* events (no person profile β they are transient and rarely convert);- * identified users get person processing as usual. Group analytics is- * unaffected either way.+ * identified users get person processing as usual. Note: PostHog drops+ * group associations on personless events, so `groups` passed here only+ * take effect for identified users β put poll/space/tier on plain+ * properties when guest events need them.** When a guest's client-side anonymous distinct_id is known (read from the* posthog-js persistence cookie via getClientAnonymousDistinctId), guestdiff --git a/apps/web/src/trpc/routers/polls/participants.ts b/apps/web/src/trpc/routers/polls/participants.tsindex 894351113..9522d3d68 100644--- a/apps/web/src/trpc/routers/polls/participants.ts+++ b/apps/web/src/trpc/routers/polls/participants.ts@@ -333,6 +333,8 @@ export const participants = router({title: true,space: {select: {+ id: true,+ tier: true,showBranding: true,primaryColor: true,image: true,@@ -384,6 +386,11 @@ export const participants = router({event: "poll_response_submit",properties: {participant_id: participant.id,+ // plain properties, not groups: guest events are personless and+ // PostHog drops group associations without person processing+ poll_id: pollId,+ space_id: participant.poll.space?.id,+ tier: participant.poll.space?.tier,has_email: !!email,has_note: !!participant.note,note_length: participant.note?.length,diff --git a/packages/emails/src/components/powered-by.tsx b/packages/emails/src/components/powered-by.tsxindex f6a8dc120..125e0e45e 100644--- a/packages/emails/src/components/powered-by.tsx+++ b/packages/emails/src/components/powered-by.tsx@@ -30,7 +30,7 @@ export async function PoweredBy({a: (<Linkcolor={chrome.primaryColor}- href="https://rallly.co?utm_source=email&utm_medium=transactional"+ href="https://rallly.co?utm_source=rallly&utm_medium=email&utm_campaign=powered_by"/>),}}