mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
📈 Track analytics
This commit is contained in:
parent
8ff3313ca0
commit
0b5c7e18fd
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,7 @@ import { ProFeatureBadge } from "@/components/pro-feature-badge";
|
|||
import { Trans } from "@/components/trans";
|
||||
import { usePlan } from "@/contexts/plan";
|
||||
import { usePoll } from "@/contexts/poll";
|
||||
import { usePostHog } from "@/utils/posthog";
|
||||
|
||||
import { DeletePollDialog } from "./manage-poll/delete-poll-dialog";
|
||||
import { useCsvExporter } from "./manage-poll/use-csv-exporter";
|
||||
|
@ -148,6 +149,7 @@ const ManagePoll: React.FunctionComponent<{
|
|||
const finalizeDialog = useDialog();
|
||||
const paywallDialog = useDialog();
|
||||
const plan = usePlan();
|
||||
const posthog = usePostHog();
|
||||
const { exportToCsv } = useCsvExporter();
|
||||
|
||||
return (
|
||||
|
@ -206,6 +208,10 @@ const ManagePoll: React.FunctionComponent<{
|
|||
onClick={() => {
|
||||
if (plan === "free") {
|
||||
paywallDialog.trigger();
|
||||
posthog?.capture("trigger paywall", {
|
||||
poll_id: poll.id,
|
||||
action: "finalize",
|
||||
});
|
||||
} else {
|
||||
finalizeDialog.trigger();
|
||||
}
|
||||
|
@ -231,6 +237,10 @@ const ManagePoll: React.FunctionComponent<{
|
|||
onClick={() => {
|
||||
if (plan === "free") {
|
||||
paywallDialog.trigger();
|
||||
posthog?.capture("trigger paywall", {
|
||||
poll_id: poll.id,
|
||||
action: "duplicate",
|
||||
});
|
||||
} else {
|
||||
duplicateDialog.trigger();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue