mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-16 07:55:29 +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 { Trans } from "@/components/trans";
|
||||||
import { usePlan } from "@/contexts/plan";
|
import { usePlan } from "@/contexts/plan";
|
||||||
import { usePoll } from "@/contexts/poll";
|
import { usePoll } from "@/contexts/poll";
|
||||||
|
import { usePostHog } from "@/utils/posthog";
|
||||||
|
|
||||||
import { DeletePollDialog } from "./manage-poll/delete-poll-dialog";
|
import { DeletePollDialog } from "./manage-poll/delete-poll-dialog";
|
||||||
import { useCsvExporter } from "./manage-poll/use-csv-exporter";
|
import { useCsvExporter } from "./manage-poll/use-csv-exporter";
|
||||||
|
@ -148,6 +149,7 @@ const ManagePoll: React.FunctionComponent<{
|
||||||
const finalizeDialog = useDialog();
|
const finalizeDialog = useDialog();
|
||||||
const paywallDialog = useDialog();
|
const paywallDialog = useDialog();
|
||||||
const plan = usePlan();
|
const plan = usePlan();
|
||||||
|
const posthog = usePostHog();
|
||||||
const { exportToCsv } = useCsvExporter();
|
const { exportToCsv } = useCsvExporter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -206,6 +208,10 @@ const ManagePoll: React.FunctionComponent<{
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (plan === "free") {
|
if (plan === "free") {
|
||||||
paywallDialog.trigger();
|
paywallDialog.trigger();
|
||||||
|
posthog?.capture("trigger paywall", {
|
||||||
|
poll_id: poll.id,
|
||||||
|
action: "finalize",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
finalizeDialog.trigger();
|
finalizeDialog.trigger();
|
||||||
}
|
}
|
||||||
|
@ -231,6 +237,10 @@ const ManagePoll: React.FunctionComponent<{
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (plan === "free") {
|
if (plan === "free") {
|
||||||
paywallDialog.trigger();
|
paywallDialog.trigger();
|
||||||
|
posthog?.capture("trigger paywall", {
|
||||||
|
poll_id: poll.id,
|
||||||
|
action: "duplicate",
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
duplicateDialog.trigger();
|
duplicateDialog.trigger();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue