mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-08 15:49:15 -06:00
remove user fingerprinting
This commit is contained in:
@@ -21,18 +21,12 @@ export default function ResultsAnalytics({ formId }) {
|
||||
const stats = useMemo(() => {
|
||||
if (analytics) {
|
||||
return [
|
||||
{
|
||||
id: "uniqueUsers",
|
||||
name: "Unique Users",
|
||||
stat: analytics.uniqueUsers || "--",
|
||||
toolTipText: "Tracked without cookies using fingerprinting technique",
|
||||
trend: undefined,
|
||||
},
|
||||
{
|
||||
id: "totalSubmissions",
|
||||
name: "Total Submissions",
|
||||
stat: analytics.totalSubmissions || "--",
|
||||
trend: undefined,
|
||||
toolTipText: undefined,
|
||||
},
|
||||
{
|
||||
id: "lastSubmission",
|
||||
@@ -41,6 +35,7 @@ export default function ResultsAnalytics({ formId }) {
|
||||
? timeSince(analytics.lastSubmissionAt)
|
||||
: "--",
|
||||
smallerText: true,
|
||||
toolTipText: undefined,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -51,10 +46,10 @@ export default function ResultsAnalytics({ formId }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<h2 className="mt-8 text-xl font-bold text-ui-gray-dark">Analytics</h2>
|
||||
<div className="my-8">
|
||||
<h2 className="text-xl font-bold text-ui-gray-dark">Analytics</h2>
|
||||
<div>
|
||||
<dl className="grid grid-cols-1 gap-5 mt-8 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<dl className="grid grid-cols-1 gap-5 mt-8 sm:grid-cols-2">
|
||||
{stats.map((item) => (
|
||||
<AnalyticsCard
|
||||
key={item.id}
|
||||
@@ -95,6 +90,6 @@ export default function ResultsAnalytics({ formId }) {
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,18 +33,12 @@ export default function ResultsSummary({ formId }) {
|
||||
const stats = useMemo(() => {
|
||||
if (insights) {
|
||||
return [
|
||||
{
|
||||
id: "uniqueUsers",
|
||||
name: "Unique Users",
|
||||
stat: insights.uniqueUsers || "--",
|
||||
toolTipText: "Tracked without cookies using fingerprinting technique",
|
||||
trend: undefined,
|
||||
},
|
||||
{
|
||||
id: "totalSubmissions",
|
||||
name: "Total Submissions",
|
||||
stat: insights.totalSubmissions || "--",
|
||||
trend: undefined,
|
||||
toolTipText: undefined,
|
||||
},
|
||||
{
|
||||
id: "lastSubmission",
|
||||
@@ -53,6 +47,7 @@ export default function ResultsSummary({ formId }) {
|
||||
? timeSince(insights.lastSubmissionAt)
|
||||
: "--",
|
||||
smallerText: true,
|
||||
toolTipText: undefined,
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -67,7 +62,7 @@ export default function ResultsSummary({ formId }) {
|
||||
<h2 className="mt-8 text-xl font-bold text-ui-gray-dark">
|
||||
Responses Overview
|
||||
</h2>
|
||||
<dl className="grid grid-cols-1 gap-5 mt-8 sm:grid-cols-2 lg:grid-cols-3">
|
||||
<dl className="grid grid-cols-1 gap-5 mt-8 sm:grid-cols-2">
|
||||
{stats.map((item) => (
|
||||
<AnalyticsCard
|
||||
key={item.id}
|
||||
|
||||
@@ -61,14 +61,10 @@ export const getSubmission = (submissionSession, schema) => {
|
||||
export const getSubmissionAnalytics = (
|
||||
submissionSessions: SubmissionSession[]
|
||||
) => {
|
||||
const uniqueUsers = [];
|
||||
let totalSubmissions = 0;
|
||||
let lastSubmissionAt = null;
|
||||
for (const submissionSession of submissionSessions) {
|
||||
// collect unique users
|
||||
if (!uniqueUsers.includes(submissionSession.userFingerprint)) {
|
||||
uniqueUsers.push(submissionSession.userFingerprint);
|
||||
}
|
||||
if (submissionSession.events.length > 0) {
|
||||
totalSubmissions += 1;
|
||||
const lastSubmission =
|
||||
@@ -84,7 +80,6 @@ export const getSubmissionAnalytics = (
|
||||
}
|
||||
return {
|
||||
lastSubmissionAt,
|
||||
uniqueUsers: uniqueUsers.length,
|
||||
totalSubmissions: totalSubmissions,
|
||||
};
|
||||
};
|
||||
@@ -155,4 +150,4 @@ export const getSubmissionSummary = (
|
||||
}
|
||||
}
|
||||
return summary;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"@headlessui/react": "^1.6.1",
|
||||
"@heroicons/react": "^2.0.8",
|
||||
"@prisma/client": "^4.2.1",
|
||||
"@snoopforms/react": "^0.2.2",
|
||||
"@snoopforms/react": "^0.3.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"chart.js": "^3.8.2",
|
||||
"crypto": "^1.0.1",
|
||||
|
||||
@@ -27,12 +27,10 @@ export default async function handle(
|
||||
// check if user is form owner
|
||||
const ownership = await formHasOwnership(session, formId);
|
||||
if (!ownership) {
|
||||
return res
|
||||
.status(401)
|
||||
.json({
|
||||
message:
|
||||
"You are not authorized to access this form and their submissions",
|
||||
});
|
||||
return res.status(401).json({
|
||||
message:
|
||||
"You are not authorized to access this form and their submissions",
|
||||
});
|
||||
}
|
||||
|
||||
const submissionSessionsData = await prisma.submissionSession.findMany({
|
||||
@@ -57,9 +55,8 @@ export default async function handle(
|
||||
// Required fields in body: -
|
||||
// Optional fields in body: -
|
||||
if (req.method === "POST") {
|
||||
const { userFingerprint } = req.body;
|
||||
const prismaRes = await prisma.submissionSession.create({
|
||||
data: { userFingerprint, form: { connect: { id: formId } } },
|
||||
data: { form: { connect: { id: formId } } },
|
||||
});
|
||||
return res.json(prismaRes);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function ResultsInsightsPage() {
|
||||
breadcrumbs={[{ name: form?.name, href: "#", current: true }]}
|
||||
steps={formMenuSteps}
|
||||
currentStep="results"
|
||||
limitHeightScreen={true}
|
||||
limitHeightScreen={false}
|
||||
>
|
||||
<SecondNavBar
|
||||
navItems={formResultsSecondNavigation}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `userFingerprint` on the `SubmissionSession` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "SubmissionSession" DROP COLUMN "userFingerprint";
|
||||
@@ -65,7 +65,6 @@ model SubmissionSession {
|
||||
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
||||
form Form @relation(fields: [formId], references: [id], onDelete: Cascade)
|
||||
formId String
|
||||
userFingerprint String
|
||||
events SessionEvent[]
|
||||
}
|
||||
|
||||
|
||||
18
yarn.lock
18
yarn.lock
@@ -58,13 +58,6 @@
|
||||
minimatch "^3.1.2"
|
||||
strip-json-comments "^3.1.1"
|
||||
|
||||
"@fingerprintjs/fingerprintjs@^3.3.3":
|
||||
version "3.3.4"
|
||||
resolved "https://registry.yarnpkg.com/@fingerprintjs/fingerprintjs/-/fingerprintjs-3.3.4.tgz#5d65fe0ab7220195c436851d02b02f92ac3b5bec"
|
||||
integrity sha512-px1imhVDAEp0pI7LBcsUYAMlGsJZxReXVsJbla6e1+hSePZU7oPEtauyGhJH0cSXrQS5w/uhu5btmltkUgvUTw==
|
||||
dependencies:
|
||||
tslib "^2.0.1"
|
||||
|
||||
"@headlessui/react@^1.6.1", "@headlessui/react@^1.6.6":
|
||||
version "1.6.6"
|
||||
resolved "https://registry.yarnpkg.com/@headlessui/react/-/react-1.6.6.tgz#3073c066b85535c9d28783da0a4d9288b5354d0c"
|
||||
@@ -232,12 +225,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27"
|
||||
integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA==
|
||||
|
||||
"@snoopforms/react@^0.2.2":
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@snoopforms/react/-/react-0.2.2.tgz#9f3020cca581d72056c405bbf1278d16aea7d30e"
|
||||
integrity sha512-YPApJFEDv3L+9aMTg3Kzr+aFHFhfMHbYrxzvBRIgvVoOzUIL/wtVwskJtCzP2C+YPS7NvQFjaWJFvxTGRzVE0g==
|
||||
"@snoopforms/react@^0.3.0":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@snoopforms/react/-/react-0.3.0.tgz#00060b6b626eb53ac85a6ed9c0f5ebe50d2c992a"
|
||||
integrity sha512-IPlBDE3A46uLffzs/F4HXyuWyHekU0TY23aybBVCfqmGBWw+Iz22MHv6ak2BT5TwFAg+97APoLg0c/Oi5oydmw==
|
||||
dependencies:
|
||||
"@fingerprintjs/fingerprintjs" "^3.3.3"
|
||||
"@headlessui/react" "^1.6.6"
|
||||
|
||||
"@swc/helpers@0.4.2":
|
||||
@@ -2617,7 +2609,7 @@ tslib@^1.8.1:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.1, tslib@^2.4.0:
|
||||
tslib@^2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
|
||||
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
|
||||
|
||||
Reference in New Issue
Block a user