mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-04 10:30:00 -06:00
update posthog events to also submit form type
This commit is contained in:
@@ -109,13 +109,17 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
|
||||
if (submission.finished) {
|
||||
capturePosthogEvent(form.organisationId, "submission finished", {
|
||||
formId,
|
||||
formType: form.type,
|
||||
});
|
||||
captureTelemetry("submission finished");
|
||||
} else {
|
||||
capturePosthogEvent(form.organisationId, "submission updated", {
|
||||
formId,
|
||||
formType: form.type,
|
||||
});
|
||||
captureTelemetry("submission updated", {
|
||||
formType: form.type,
|
||||
});
|
||||
captureTelemetry("submission updated");
|
||||
}
|
||||
res.json(submissionResult);
|
||||
}
|
||||
|
||||
@@ -94,10 +94,13 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
|
||||
// run pipelines
|
||||
await runPipelines(pipelineEvents, form, submission, submissionResult);
|
||||
// tracking
|
||||
capturePosthogEvent(form.organisationId, "submission received", {
|
||||
capturePosthogEvent(form.organisationId, "submission created", {
|
||||
formId,
|
||||
formType: form.type,
|
||||
});
|
||||
captureTelemetry("submission created", {
|
||||
formType: form.type,
|
||||
});
|
||||
captureTelemetry("submission received");
|
||||
res.json(submissionResult);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user