mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-12 19:03:42 -05:00
chore: improve posthog tracking with survey created event (#2964)
This commit is contained in:
@@ -64,7 +64,9 @@ test.describe("JS Package Test", async () => {
|
||||
await page.goto(htmlFile);
|
||||
|
||||
// Formbricks In App Sync has happened
|
||||
const syncApi = await page.waitForResponse((response) => response.url().includes("/app/sync"));
|
||||
const syncApi = await page.waitForResponse((response) => response.url().includes("/app/sync"), {
|
||||
timeout: 20000,
|
||||
});
|
||||
expect(syncApi.status()).toBe(200);
|
||||
|
||||
// Formbricks Modal exists in the DOM
|
||||
|
||||
@@ -29,6 +29,7 @@ import { subscribeOrganizationMembersToSurveyResponses } from "../organization/s
|
||||
import { personCache } from "../person/cache";
|
||||
import { getPerson } from "../person/service";
|
||||
import { structuredClone } from "../pollyfills/structuredClone";
|
||||
import { capturePosthogEnvironmentEvent } from "../posthogServer";
|
||||
import { productCache } from "../product/cache";
|
||||
import { getProductByEnvironmentId } from "../product/service";
|
||||
import { responseCache } from "../response/cache";
|
||||
@@ -696,6 +697,11 @@ export const createSurvey = async (
|
||||
await subscribeOrganizationMembersToSurveyResponses(survey.id, createdBy);
|
||||
}
|
||||
|
||||
await capturePosthogEnvironmentEvent(survey.environmentId, "survey created", {
|
||||
surveyId: survey.id,
|
||||
surveyType: survey.type,
|
||||
});
|
||||
|
||||
return transformedSurvey;
|
||||
} catch (error) {
|
||||
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
||||
|
||||
Reference in New Issue
Block a user