mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-14 17:36:49 +02:00
Update analytics (#432)
This commit is contained in:
parent
a4ca5f1676
commit
b0aa9db26d
18 changed files with 122 additions and 106 deletions
|
@ -2,7 +2,7 @@ import { NextPage } from "next";
|
|||
import Head from "next/head";
|
||||
import { useRouter } from "next/router";
|
||||
import { useTranslation } from "next-i18next";
|
||||
import { usePlausible } from "next-plausible";
|
||||
import posthog from "posthog-js";
|
||||
import React from "react";
|
||||
import { useSessionStorage } from "react-use";
|
||||
|
||||
|
@ -92,16 +92,12 @@ const Page: NextPage<CreatePollPageProps> = ({
|
|||
|
||||
const [isRedirecting, setIsRedirecting] = React.useState(false);
|
||||
|
||||
const plausible = usePlausible();
|
||||
|
||||
const createPoll = trpc.useMutation(["polls.create"], {
|
||||
onSuccess: (res) => {
|
||||
setIsRedirecting(true);
|
||||
plausible("Created poll", {
|
||||
props: {
|
||||
numberOfOptions: formData.options?.options?.length,
|
||||
optionsView: formData?.options?.view,
|
||||
},
|
||||
posthog.capture("created poll", {
|
||||
numberOfOptions: formData.options?.options?.length,
|
||||
optionsView: formData?.options?.view,
|
||||
});
|
||||
setPersistedFormData(initialNewEventData);
|
||||
router.replace(`/admin/${res.urlId}?sharing=true`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue